Repository navigation
Conversation
Replace the fatal assertion with an explicit failure and return before using the chiplet JSON entry pointer. Coverity does not infer the assertion macro control flow and reports a possible null dereference. The test still fails immediately when the expected chiplet entry is absent. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Use an explicit failure-and-return guard for the Backside category search, matching the chiplet lookup already fixed in this PR. The ASSERT_NE macro can hide null control flow from Coverity; the branch preserves test failure and prevents the dereference. Address the reviewer-requested matching lookup without changing production logic. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request replaces ASSERT_NE assertions with manual nullptr checks using ADD_FAILURE() and explicit returns in TestTileGenerator.cpp. The feedback suggests using the more idiomatic Google Test FAIL() macro instead, which automatically generates a fatal failure and returns from the function, simplifying the code.
Comment on lines
+2171
to
+2174
| if (die_entry == nullptr) { | ||
| ADD_FAILURE() << "tech response has no chiplet " << die0->getName(); | ||
| return; | ||
| } |
Contributor
There was a problem hiding this comment.
In Google Test, FAIL() is a fatal assertion macro that automatically generates a failure and returns from the current function. Using FAIL() is more concise and idiomatic than combining ADD_FAILURE() with an explicit return; statement.
if (die_entry == nullptr) {
FAIL() << "tech response has no chiplet " << die0->getName();
}
Comment on lines
+4952
to
+4955
| if (backside_node == nullptr) { | ||
| ADD_FAILURE() << "layer_hierarchy missing Backside category node"; | ||
| return; | ||
| } |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coverity Defect Log
Solution
FORWARD_NULLRelated