Fix accessing the contents of a direct string (#2261)
In the `ecma_string_get_chars` method the contents of a direct string is accessed incorrectly. It tries to extract the magic string id from the string pointer but the direct string does not need this step. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
@@ -1118,6 +1118,15 @@ main (void)
|
||||
|
||||
jerry_release_value (args[0]);
|
||||
|
||||
const char *test_magic_str_access_src_p = "'console'.charAt(6) == 'e'";
|
||||
res = jerry_eval ((const jerry_char_t *) test_magic_str_access_src_p,
|
||||
strlen (test_magic_str_access_src_p),
|
||||
false);
|
||||
TEST_ASSERT (jerry_value_is_boolean (res));
|
||||
TEST_ASSERT (jerry_get_boolean_value (res) == true);
|
||||
|
||||
jerry_release_value (res);
|
||||
|
||||
cesu8_length = jerry_get_string_length (args[1]);
|
||||
cesu8_sz = jerry_get_string_size (args[1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user