This patch adds getArgsSVal method to ProgramState that allows the user to obtain SVals of argumetns used in a call that created the given StackFrameCtx. I know this isn't perfect (Alexey Sidorin pointed out that there is a problem with line 741 - argument values may be overwritten) but wanted to submit it separate from other changes that I do and find _the_ right solution.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I'm ok with constructing SymbolRegionValue for ArgLoc manually and adding a comment like FIXME: leaking implementation details of RegionStoreManager.
Comment Actions
Note that the uncontrolled recursion checker will not be able to test this overwrite problem, because overwriting the argument region spoils the stack frame for it.
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h | ||
---|---|---|
743 | Hmm, this should work: ~ 743 StoreManager &storeMgr = stateMgr->getStoreManager(); + 744 return storeMgr.getBinding(storeMgr.getInitialStore(SFC).getStore(), + 745 ArgLoc); |
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h | ||
---|---|---|
739 | Rather in the environment. In fact, here we are relying on the store to *always* have something for us, even if wasn't directly bound earlier. |
Rather in the environment. In fact, here we are relying on the store to *always* have something for us, even if wasn't directly bound earlier.