Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

dawagner
Copy link
Contributor

Fix a segfault in the showMapping command.

@@            master    #352   diff @@
======================================
Files          210     210
Stmts         7163    7173    +10
Branches         0       0
Methods          0       0
======================================
+ Hit           5698    5745    +47
Partial          0       0
+ Missed        1465    1428    -37

Review entire Coverage Diff as of 987399c

Powered by Codecov. Updated on successful CI builds.

  

@dawagner dawagner added the bug label Feb 15, 2016
@dawagner dawagner changed the title Fix show mapping segfault [review] Fix show mapping segfault Feb 15, 2016
@dawagner dawagner force-pushed the fix-showMapping-segfault branch from f36b0ea to 81c3c75 Compare February 15, 2016 17:37
@codecov-io
Copy link

Current coverage is 80.33%

Merging #352 into master will increase coverage by +0.79% as of a692a7a

@@            master    #352   diff @@
======================================
  Files          210     210       
  Stmts         7163    7179    +16
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit           5698    5767    +69
  Partial          0       0       
+ Missed        1465    1412    -53

Review entire Coverage Diff as of a692a7a

Powered by Codecov. Updated on successful CI builds.

@tcahuzax
Copy link
Contributor

👎

}

return pSubsystemObject;
return NULL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nullptr ?

@dawagner dawagner force-pushed the fix-showMapping-segfault branch from 81c3c75 to f6e92d5 Compare February 16, 2016 10:01
…ct found

This function was improperly returning the latest candidate in case of failure
instead of returning a nullptr. This led the caller to use the returned
pointer even if it was not correct.

Signed-off-by: David Wagner <david.wagner@intel.com>
@dawagner dawagner force-pushed the fix-showMapping-segfault branch 2 times, most recently from 2a0797e to 4d07de1 Compare February 16, 2016 15:12
It was segfaulting due to an erroneous static_cast.

Simplify the code related to showMapping by taking into account the fact that
all ConfigurableElements may have a mapping (SystemClass currently doesn't have
any but it can simply return an empty mapping). The leaf element is a special
case because the instantiation mapping may be formatted using "amends" - other
mappings may not.

Signed-off-by: David Wagner <david.wagner@intel.com>
dawagner added a commit that referenced this pull request Feb 16, 2016
Fix a segfault in the showMapping command.
@dawagner dawagner merged commit 155f46f into intel:master Feb 16, 2016
@dawagner dawagner deleted the fix-showMapping-segfault branch February 16, 2016 15:57
@krocard krocard changed the title [review] Fix show mapping segfault Fix show mapping segfault Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants