Fixes for interpreter.*

This commit is contained in:
e.gavrin
2014-08-12 00:53:40 +04:00
parent 464bf578cc
commit d40c21b616
2 changed files with 85 additions and 81 deletions
+8 -4
View File
@@ -24,7 +24,8 @@
#include "jerry-libc.h" #include "jerry-libc.h"
#define INIT_OP_FUNC(name) [ __op__idx_##name ] = opfunc_##name, #define INIT_OP_FUNC(name) [ __op__idx_##name ] = opfunc_##name,
static const opfunc __opfuncs[LAST_OP] = { static const opfunc __opfuncs[LAST_OP] =
{
OP_LIST (INIT_OP_FUNC) OP_LIST (INIT_OP_FUNC)
}; };
#undef INIT_OP_FUNC #undef INIT_OP_FUNC
@@ -134,7 +135,8 @@ run_int_from_pos (opcode_counter_t start_pos,
JERRY_ASSERT (!ecma_is_completion_value_normal (completion) JERRY_ASSERT (!ecma_is_completion_value_normal (completion)
|| ecma_is_empty_completion_value (completion)); || ecma_is_empty_completion_value (completion));
} while ( completion.type == ECMA_COMPLETION_TYPE_NORMAL ); }
while (completion.type == ECMA_COMPLETION_TYPE_NORMAL);
if (completion.type == ECMA_COMPLETION_TYPE_BREAK) if (completion.type == ECMA_COMPLETION_TYPE_BREAK)
{ {
@@ -176,7 +178,8 @@ try_get_string_by_idx(T_IDX idx, /**< literal id */
const ecma_char_t *str_p = deserialize_string_by_id (idx); const ecma_char_t *str_p = deserialize_string_by_id (idx);
JERRY_ASSERT (str_p != NULL); JERRY_ASSERT (str_p != NULL);
FIXME( strlen for ecma_char_t ); FIXME (ecma_char_t strlen);
ssize_t req_length = (ssize_t)__strlen ((const char*)str_p) + 1; ssize_t req_length = (ssize_t)__strlen ((const char*)str_p) + 1;
if (buffer_size < req_length) if (buffer_size < req_length)
@@ -184,7 +187,8 @@ try_get_string_by_idx(T_IDX idx, /**< literal id */
return -req_length; return -req_length;
} }
FIXME( strncpy for ecma_char_t ); FIXME (ecma_char_t strncpy);
__strncpy ((char*)buffer_p, (const char*)str_p, (size_t)req_length); __strncpy ((char*)buffer_p, (const char*)str_p, (size_t)req_length);
return req_length; return req_length;