Skip to content

Commit

Permalink
Fix not checking if an Array is not extensible in the native setter f…
Browse files Browse the repository at this point in the history
…unction

Fixes #33

Signed-off-by: Daniel Balla [email protected]
  • Loading branch information
Daniel Balla committed Jan 2, 2019
1 parent 8f6925a commit 16c8269
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/VMInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bool VMInstance::arrayLengthNativeSetter(ExecutionState& state, Object* self, Sm
}

bool ret;
if (UNLIKELY(!isPrimitiveValue && !self->structure()->readProperty(state, (size_t)0).m_descriptor.isWritable())) {
if (UNLIKELY(!self->isExtensible() || (!isPrimitiveValue && !self->structure()->readProperty(state, (size_t)0).m_descriptor.isWritable()))) {
ret = false;
} else {
ret = self->asArrayObject()->setArrayLength(state, newLen);
Expand Down

0 comments on commit 16c8269

Please sign in to comment.