mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Eliminate segfault when array changes to non-fast mode (#252)
Fixes #132 Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
This commit is contained in:
parent
e0dd0a1e9c
commit
4e1d74c2df
2 changed files with 21 additions and 1 deletions
|
|
@ -425,8 +425,8 @@ Value ByteCodeInterpreter::interpret(ExecutionState& state, ByteCodeBlock* byteC
|
|||
const Value& property = registerFile[code->m_propertyRegisterIndex];
|
||||
if (LIKELY(willBeObject.isObject() && (willBeObject.asPointerValue())->hasTag(g_arrayObjectTag))) {
|
||||
ArrayObject* arr = willBeObject.asObject()->asArrayObject();
|
||||
uint32_t idx = property.tryToUseAsArrayIndex(state);
|
||||
if (LIKELY(arr->isFastModeArray())) {
|
||||
uint32_t idx = property.tryToUseAsArrayIndex(state);
|
||||
if (LIKELY(idx != Value::InvalidArrayIndexValue)) {
|
||||
uint32_t len = arr->getArrayLength(state);
|
||||
if (UNLIKELY(len <= idx)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue