-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update cppcheck #5108
Update cppcheck #5108
Conversation
jerry-ext/util/sources.c
Outdated
if (tmp == NULL) { | ||
return jerry_throw_sz(JERRY_ERROR_COMMON, "Out of memory."); | ||
} | ||
source_p = tmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is a new temporary needed? why not simply
source_p = realloc (source_p, new_size);
if (source_p == NULL) {
return jerry_throw_sz(JERRY_ERROR_COMMON, "Out of memory.");
}
?
jerry-port/common/jerry-port-io.c
Outdated
{ | ||
jerry_port_fatal (JERRY_FATAL_OUT_OF_MEMORY); | ||
} | ||
line_p = tmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
line_p = realloc (line_p, allocated);
if (line_p == NULL)
{
jerry_port_fatal (JERRY_FATAL_OUT_OF_MEMORY);
}
?
tests/unit-core/test-api.c
Outdated
jerry_value_t handler = jerry_object (); | ||
jerry_value_t proxy = jerry_proxy (target, handler); | ||
jerry_value_t handler_ = jerry_object (); | ||
jerry_value_t proxy = jerry_proxy (target, handler_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't nice. what is the problem of cppcheck with handler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was that is shadowed the handler
function defined at line 64.
I agree its not a good name, it was just a placeholder.
32c4f76
to
f7182d7
Compare
df7afee
to
901a7af
Compare
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 [email protected]
901a7af
to
fbaa908
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This patch depends on #5106
Once that is merged, this patch will be rebased on only include the cppcheck commit.
In this patch:
The new version of cppcheck raises warnings for many potential
issues that are guarded against, so those warnings have been
supressed.
jerry-ext/util/sources.c
jerry-port/common/jerry-port-io.c