Check reference count of objects

Throw an error if the object reference count reached the limit.
Related issue: #118

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-02-11 15:14:40 +00:00
parent 80811c8332
commit 1dde538224
5 changed files with 20 additions and 4 deletions
+2 -3
View File
@@ -1334,11 +1334,10 @@ ecma_get_property_descriptor_from_property (ecma_property_t *prop_p) /**< proper
void
ecma_bytecode_ref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
{
/* Abort program if maximum reference number is reached.
* Note: This is not tested for objects. */
/* Abort program if maximum reference number is reached. */
if ((bytecode_p->status_flags >> ECMA_BYTECODE_REF_SHIFT) >= 0x3ff)
{
jerry_fatal (ERR_UNIMPLEMENTED_CASE);
jerry_fatal (ERR_REF_COUNT_LIMIT);
}
bytecode_p->status_flags = (uint16_t) (bytecode_p->status_flags + (1 << ECMA_BYTECODE_REF_SHIFT));