Guard assert-related functions
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
@@ -1314,6 +1314,7 @@ ecma_get_magic_string_ex (lit_magic_string_ex_id_t id) /**< external magic strin
|
|||||||
return ecma_new_ecma_string_from_magic_string_ex_id (id);
|
return ecma_new_ecma_string_from_magic_string_ex_id (id);
|
||||||
} /* ecma_get_magic_string_ex */
|
} /* ecma_get_magic_string_ex */
|
||||||
|
|
||||||
|
#ifndef JERRY_NDEBUG
|
||||||
/**
|
/**
|
||||||
* Long path part of ecma_is_string_magic
|
* Long path part of ecma_is_string_magic
|
||||||
*
|
*
|
||||||
@@ -1338,6 +1339,7 @@ ecma_is_string_magic_longpath (const ecma_string_t *string_p, /**< ecma-string *
|
|||||||
|
|
||||||
return lit_is_utf8_string_magic (utf8_str_p, utf8_str_size, out_id_p);
|
return lit_is_utf8_string_magic (utf8_str_p, utf8_str_size, out_id_p);
|
||||||
} /* ecma_is_string_magic_longpath */
|
} /* ecma_is_string_magic_longpath */
|
||||||
|
#endif /* !JERRY_NDEBUG */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if passed string equals to one of magic strings
|
* Check if passed string equals to one of magic strings
|
||||||
@@ -1365,8 +1367,10 @@ ecma_is_string_magic (const ecma_string_t *string_p, /**< ecma-string */
|
|||||||
* should return ecma-string with ECMA_STRING_CONTAINER_MAGIC_STRING
|
* should return ecma-string with ECMA_STRING_CONTAINER_MAGIC_STRING
|
||||||
* container type if new ecma-string's content is equal to one of magic strings.
|
* container type if new ecma-string's content is equal to one of magic strings.
|
||||||
*/
|
*/
|
||||||
|
#ifndef JERRY_NDEBUG
|
||||||
JERRY_ASSERT (ecma_string_get_length (string_p) > LIT_MAGIC_STRING_LENGTH_LIMIT
|
JERRY_ASSERT (ecma_string_get_length (string_p) > LIT_MAGIC_STRING_LENGTH_LIMIT
|
||||||
|| !ecma_is_string_magic_longpath (string_p, out_id_p));
|
|| !ecma_is_string_magic_longpath (string_p, out_id_p));
|
||||||
|
#endif /* !JERRY_NDEBUG */
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,6 +266,7 @@ lit_find_literal_by_num (const ecma_number_t num) /**< a number to search for */
|
|||||||
return NULL;
|
return NULL;
|
||||||
} /* lit_find_literal_by_num */
|
} /* lit_find_literal_by_num */
|
||||||
|
|
||||||
|
#ifndef JERRY_NDEBUG
|
||||||
/**
|
/**
|
||||||
* Check if literal really exists in the storage
|
* Check if literal really exists in the storage
|
||||||
*
|
*
|
||||||
@@ -289,6 +290,7 @@ lit_literal_exists (lit_literal_t lit) /**< literal to check for existence */
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
} /* lit_literal_exists */
|
} /* lit_literal_exists */
|
||||||
|
#endif /* !JERRY_NDEBUG */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert compressed pointer to literal
|
* Convert compressed pointer to literal
|
||||||
@@ -299,7 +301,9 @@ lit_literal_t
|
|||||||
lit_get_literal_by_cp (lit_cpointer_t lit_cp) /**< compressed pointer to literal */
|
lit_get_literal_by_cp (lit_cpointer_t lit_cp) /**< compressed pointer to literal */
|
||||||
{
|
{
|
||||||
lit_literal_t lit = lit_cpointer_decompress (lit_cp);
|
lit_literal_t lit = lit_cpointer_decompress (lit_cp);
|
||||||
|
#ifndef JERRY_NDEBUG
|
||||||
JERRY_ASSERT (lit_literal_exists (lit));
|
JERRY_ASSERT (lit_literal_exists (lit));
|
||||||
|
#endif /* !JERRY_NDEBUG */
|
||||||
|
|
||||||
return lit;
|
return lit;
|
||||||
} /* lit_get_literal_by_cp */
|
} /* lit_get_literal_by_cp */
|
||||||
|
|||||||
Reference in New Issue
Block a user