Skip to content

Commit 2324617

Browse files
author
Zsolt Borbély
committed
Guard assert-related functions
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
1 parent 87b6df2 commit 2324617

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

jerry-core/ecma/base/ecma-helpers-string.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,7 @@ ecma_get_magic_string_ex (lit_magic_string_ex_id_t id) /**< external magic strin
13141314
return ecma_new_ecma_string_from_magic_string_ex_id (id);
13151315
} /* ecma_get_magic_string_ex */
13161316

1317+
#ifndef JERRY_NDEBUG
13171318
/**
13181319
* Long path part of ecma_is_string_magic
13191320
*
@@ -1338,6 +1339,7 @@ ecma_is_string_magic_longpath (const ecma_string_t *string_p, /**< ecma-string *
13381339

13391340
return lit_is_utf8_string_magic (utf8_str_p, utf8_str_size, out_id_p);
13401341
} /* ecma_is_string_magic_longpath */
1342+
#endif /* !JERRY_NDEBUG */
13411343

13421344
/**
13431345
* 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 */
13651367
* should return ecma-string with ECMA_STRING_CONTAINER_MAGIC_STRING
13661368
* container type if new ecma-string's content is equal to one of magic strings.
13671369
*/
1370+
#ifndef JERRY_NDEBUG
13681371
JERRY_ASSERT (ecma_string_get_length (string_p) > LIT_MAGIC_STRING_LENGTH_LIMIT
13691372
|| !ecma_is_string_magic_longpath (string_p, out_id_p));
1373+
#endif /* !JERRY_NDEBUG */
13701374

13711375
return false;
13721376
}

jerry-core/lit/lit-literal.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ lit_find_literal_by_num (const ecma_number_t num) /**< a number to search for */
266266
return NULL;
267267
} /* lit_find_literal_by_num */
268268

269+
#ifndef JERRY_NDEBUG
269270
/**
270271
* Check if literal really exists in the storage
271272
*
@@ -289,6 +290,7 @@ lit_literal_exists (lit_literal_t lit) /**< literal to check for existence */
289290

290291
return false;
291292
} /* lit_literal_exists */
293+
#endif /* !JERRY_NDEBUG */
292294

293295
/**
294296
* Convert compressed pointer to literal
@@ -299,7 +301,9 @@ lit_literal_t
299301
lit_get_literal_by_cp (lit_cpointer_t lit_cp) /**< compressed pointer to literal */
300302
{
301303
lit_literal_t lit = lit_cpointer_decompress (lit_cp);
304+
#ifndef JERRY_NDEBUG
302305
JERRY_ASSERT (lit_literal_exists (lit));
306+
#endif /* !JERRY_NDEBUG */
303307

304308
return lit;
305309
} /* lit_get_literal_by_cp */

0 commit comments

Comments
 (0)