Update cppcheck (#5108)
Re-enable cppcheck CI job
Update cppcheck suppression list:
The new version of cppcheck raises warnings for many potential
issues that are guarded against, so those warnings have been
supressed.
Handle realloc failures:
- jerry-ext/util/sources.c
- jerry-port/common/jerry-port-io.c
Refactor test-snapshot: move each test to separate functions like some
others already were.
Rename `handler` variables inside `main` of `test-api.c` as they
shadowed the `handler` function in the same file.
JerryScript-DCO-1.0-Signed-off-by: Máté Tokodi mate.tokodi@szteszoftver.hu
This commit is contained in:
@@ -254,10 +254,7 @@ jerryx_escape_handle_internal (jerryx_escapable_handle_scope scope,
|
||||
* Escape handle to parent scope
|
||||
*/
|
||||
*result = jerryx_handle_scope_add_handle_to (found_handle, parent);
|
||||
}
|
||||
|
||||
if (should_promote)
|
||||
{
|
||||
scope->escaped = true;
|
||||
}
|
||||
return jerryx_handle_scope_ok;
|
||||
|
||||
@@ -146,6 +146,10 @@ jerryx_source_exec_stdin (void)
|
||||
|
||||
jerry_size_t new_size = source_size + line_size;
|
||||
source_p = realloc (source_p, new_size);
|
||||
if (source_p == NULL)
|
||||
{
|
||||
return jerry_throw_sz (JERRY_ERROR_COMMON, "Out of memory.");
|
||||
}
|
||||
|
||||
memcpy (source_p + source_size, line_p, line_size);
|
||||
jerry_port_line_free (line_p);
|
||||
|
||||
Reference in New Issue
Block a user