@@ -1514,8 +1514,7 @@ void CStringChecker::evalCopyCommon(CheckerContext &C, const CallEvent &Call,
1514
1514
// If we don't know how much we copied, we can at least
1515
1515
// conjure a return value for later.
1516
1516
if (lastElement.isUnknown ())
1517
- lastElement = C.getSValBuilder ().conjureSymbolVal (
1518
- nullptr , Call.getOriginExpr (), LCtx, C.blockCount ());
1517
+ lastElement = C.getSValBuilder ().conjureSymbolVal (Call, C.blockCount ());
1519
1518
1520
1519
// The byte after the last byte copied is the return value.
1521
1520
state = state->BindExpr (Call.getOriginExpr (), LCtx, lastElement);
@@ -1665,8 +1664,7 @@ void CStringChecker::evalMemcmp(CheckerContext &C, const CallEvent &Call,
1665
1664
State = CheckBufferAccess (C, State, Left, Size , AccessKind::read , CK);
1666
1665
if (State) {
1667
1666
// The return value is the comparison result, which we don't know.
1668
- SVal CmpV = Builder.conjureSymbolVal (nullptr , Call.getOriginExpr (), LCtx,
1669
- C.blockCount ());
1667
+ SVal CmpV = Builder.conjureSymbolVal (Call, C.blockCount ());
1670
1668
State = State->BindExpr (Call.getOriginExpr (), LCtx, CmpV);
1671
1669
C.addTransition (State);
1672
1670
}
@@ -1769,8 +1767,7 @@ void CStringChecker::evalstrLengthCommon(CheckerContext &C,
1769
1767
// no guarantee the full string length will actually be returned.
1770
1768
// All we know is the return value is the min of the string length
1771
1769
// and the limit. This is better than nothing.
1772
- result = C.getSValBuilder ().conjureSymbolVal (
1773
- nullptr , Call.getOriginExpr (), LCtx, C.blockCount ());
1770
+ result = C.getSValBuilder ().conjureSymbolVal (Call, C.blockCount ());
1774
1771
NonLoc resultNL = result.castAs <NonLoc>();
1775
1772
1776
1773
if (strLengthNL) {
@@ -1793,8 +1790,7 @@ void CStringChecker::evalstrLengthCommon(CheckerContext &C,
1793
1790
// If we don't know the length of the string, conjure a return
1794
1791
// value, so it can be used in constraints, at least.
1795
1792
if (result.isUnknown ()) {
1796
- result = C.getSValBuilder ().conjureSymbolVal (
1797
- nullptr , Call.getOriginExpr (), LCtx, C.blockCount ());
1793
+ result = C.getSValBuilder ().conjureSymbolVal (Call, C.blockCount ());
1798
1794
}
1799
1795
}
1800
1796
@@ -2261,8 +2257,7 @@ void CStringChecker::evalStrcpyCommon(CheckerContext &C, const CallEvent &Call,
2261
2257
// If this is a stpcpy-style copy, but we were unable to check for a buffer
2262
2258
// overflow, we still need a result. Conjure a return value.
2263
2259
if (ReturnEnd && Result.isUnknown ()) {
2264
- Result = svalBuilder.conjureSymbolVal (nullptr , Call.getOriginExpr (), LCtx,
2265
- C.blockCount ());
2260
+ Result = svalBuilder.conjureSymbolVal (Call, C.blockCount ());
2266
2261
}
2267
2262
}
2268
2263
// Set the return value.
@@ -2361,8 +2356,7 @@ void CStringChecker::evalStrcmpCommon(CheckerContext &C, const CallEvent &Call,
2361
2356
const StringLiteral *RightStrLiteral =
2362
2357
getCStringLiteral (C, state, Right.Expression , RightVal);
2363
2358
bool canComputeResult = false ;
2364
- SVal resultVal = svalBuilder.conjureSymbolVal (nullptr , Call.getOriginExpr (),
2365
- LCtx, C.blockCount ());
2359
+ SVal resultVal = svalBuilder.conjureSymbolVal (Call, C.blockCount ());
2366
2360
2367
2361
if (LeftStrLiteral && RightStrLiteral) {
2368
2362
StringRef LeftStrRef = LeftStrLiteral->getString ();
@@ -2467,16 +2461,13 @@ void CStringChecker::evalStrsep(CheckerContext &C,
2467
2461
2468
2462
// Overwrite the search string pointer. The new value is either an address
2469
2463
// further along in the same string, or NULL if there are no more tokens.
2470
- State =
2471
- State->bindLoc (*SearchStrLoc,
2472
- SVB.conjureSymbolVal (getTag (), Call.getOriginExpr (),
2473
- LCtx, CharPtrTy, C.blockCount ()),
2474
- LCtx);
2464
+ State = State->bindLoc (
2465
+ *SearchStrLoc,
2466
+ SVB.conjureSymbolVal (Call, CharPtrTy, C.blockCount (), getTag ()), LCtx);
2475
2467
} else {
2476
2468
assert (SearchStrVal.isUnknown ());
2477
2469
// Conjure a symbolic value. It's the best we can do.
2478
- Result = SVB.conjureSymbolVal (nullptr , Call.getOriginExpr (), LCtx,
2479
- C.blockCount ());
2470
+ Result = SVB.conjureSymbolVal (Call, C.blockCount ());
2480
2471
}
2481
2472
2482
2473
// Set the return value, and finish.
@@ -2519,8 +2510,7 @@ void CStringChecker::evalStdCopyCommon(CheckerContext &C,
2519
2510
2520
2511
SValBuilder &SVB = C.getSValBuilder ();
2521
2512
2522
- SVal ResultVal =
2523
- SVB.conjureSymbolVal (nullptr , Call.getOriginExpr (), LCtx, C.blockCount ());
2513
+ SVal ResultVal = SVB.conjureSymbolVal (Call, C.blockCount ());
2524
2514
State = State->BindExpr (Call.getOriginExpr (), LCtx, ResultVal);
2525
2515
2526
2516
C.addTransition (State);
0 commit comments