Skip to content

Fix crash issues#1565

Open
ksh8281 wants to merge 10 commits intoSamsung:masterfrom
ksh8281:work74
Open

Fix crash issues#1565
ksh8281 wants to merge 10 commits intoSamsung:masterfrom
ksh8281:work74

Conversation

@ksh8281
Copy link
Copy Markdown
Contributor

@ksh8281 ksh8281 commented Apr 28, 2026

No description provided.

ksh8281 added 4 commits April 28, 2026 18:58
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
Comment thread src/builtins/BuiltinTypedArray.cpp
Comment thread src/runtime/JSON.cpp
ksh8281 added 5 commits April 29, 2026 12:59
…struction

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
setArrayLength can convert the array to non-fast mode when length exceeds thresholds

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Check if this is an index property within the string length due to proxy object

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
…l even if the task was successful

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
// In some edge cases (e.g., nested eval throw with finally allocation),
// the error value might be invalid or null
if (error.hasValue()) {
return ((ValueRef*)error.value())->toStringWithoutException(ctx);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ((ValueRef*)error.value())->toStringWithoutException(ctx) dereferences the pointer returned by error.value() without verifying it is non‑null. If error.value() is null, this will cause a crash. Add a null check, e.g., if (error.hasValue() && error.value() != nullptr) before dereferencing.

// Check if error value is valid before dereferencing
// In some edge cases (e.g., nested eval throw with finally allocation),
// the error value might be invalid or null
if (error.hasValue()) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anchor on if (error.hasValue()) {. Replace the nested if-else with a guard clause that returns early when the error is absent. This flattens the control flow, reduces indentation, and makes the success path more obvious. The semantics remain unchanged because the early return still yields StringRef::emptyString() when error.hasValue() is false.

…k::pushCode

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
}

#ifndef NDEBUG
#if !defined(NDEBUG) && defined(ESCARGOT_DEBUGGER)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preprocessor guard #if !defined(NDEBUG) && defined(ESCARGOT_DEBUGGER) can be reordered for clarity. Using #if defined(ESCARGOT_DEBUGGER) && !defined(NDEBUG) makes the intent more obvious: code is compiled only when the debugger is enabled and NDEBUG is not defined. This small change improves readability and aligns with common macro ordering conventions. It preserves semantics and requires no functional changes. The guard remains localized to this block, so no cross-file impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant