Fix crash issues#1565
Conversation
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>
…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); |
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
No description provided.