@@ -123,7 +123,7 @@ InfoStackFrame::InfoStackFrame(const InfoStackFrame &s)
123123/* **/
124124ExecutionState::ExecutionState ()
125125 : initPC(nullptr ), pc(nullptr ), prevPC(nullptr ), incomingBBIndex(-1 ),
126- depth(0 ), ptreeNode(nullptr ), steppedInstructions(0 ),
126+ depth(0 ), ptreeNode(nullptr ), symbolics(std::make_shared<PList>()), steppedInstructions(0 ),
127127 steppedMemoryInstructions(0 ), instsSinceCovNew(0 ),
128128 roundingMode(llvm::APFloat::rmNearestTiesToEven), coveredNew(false ),
129129 forkDisabled(false ), prevHistory_(TargetsHistory::create()),
@@ -133,7 +133,7 @@ ExecutionState::ExecutionState()
133133
134134ExecutionState::ExecutionState (KFunction *kf)
135135 : initPC(kf->instructions), pc(initPC), prevPC(pc), incomingBBIndex(-1 ),
136- depth(0 ), ptreeNode(nullptr ), steppedInstructions(0 ),
136+ depth(0 ), ptreeNode(nullptr ), symbolics(std::make_shared<PList>()), steppedInstructions(0 ),
137137 steppedMemoryInstructions(0 ), instsSinceCovNew(0 ),
138138 roundingMode(llvm::APFloat::rmNearestTiesToEven), coveredNew(false ),
139139 forkDisabled(false ), prevHistory_(TargetsHistory::create()),
@@ -144,7 +144,7 @@ ExecutionState::ExecutionState(KFunction *kf)
144144
145145ExecutionState::ExecutionState (KFunction *kf, KBlock *kb)
146146 : initPC(kb->instructions), pc(initPC), prevPC(pc), incomingBBIndex(-1 ),
147- depth(0 ), ptreeNode(nullptr ), steppedInstructions(0 ),
147+ depth(0 ), ptreeNode(nullptr ), symbolics(std::make_shared<PList>()), steppedInstructions(0 ),
148148 steppedMemoryInstructions(0 ), instsSinceCovNew(0 ),
149149 roundingMode(llvm::APFloat::rmNearestTiesToEven), coveredNew(false ),
150150 forkDisabled(false ), prevHistory_(TargetsHistory::create()),
@@ -194,8 +194,8 @@ ExecutionState *ExecutionState::branch() {
194194}
195195
196196bool ExecutionState::inSymbolics (const MemoryObject *mo) const {
197- for (auto i : symbolics) {
198- if (mo->id == i .memoryObject ->id ) {
197+ for (auto &symbolic : * symbolics) {
198+ if (mo->id == symbolic .memoryObject ->id ) {
199199 return true ;
200200 }
201201 }
@@ -255,13 +255,12 @@ void ExecutionState::popFrame() {
255255
256256void ExecutionState::addSymbolic (const MemoryObject *mo, const Array *array,
257257 KType *type) {
258- symbolics. emplace_back (ref< const MemoryObject>(mo) , array, type);
258+ symbolics-> emplace_back (mo , array, type);
259259}
260260
261261ref<const MemoryObject>
262262ExecutionState::findMemoryObject (const Array *array) const {
263- for (unsigned i = 0 ; i != symbolics.size (); ++i) {
264- const auto &symbolic = symbolics[i];
263+ for (const auto &symbolic : *symbolics) {
265264 if (array == symbolic.array ) {
266265 return symbolic.memoryObject ;
267266 }
@@ -368,7 +367,7 @@ bool ExecutionState::resolveOnSymbolics(const ref<ConstantExpr> &addr,
368367 IDType &result) const {
369368 uint64_t address = addr->getZExtValue ();
370369
371- for (const auto &res : symbolics) {
370+ for (const auto &res : * symbolics) {
372371 const auto &mo = res.memoryObject ;
373372 // Check if the provided address is between start and end of the object
374373 // [mo->address, mo->address + mo->size) or the object is a 0-sized object.
0 commit comments