File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -292,4 +292,28 @@ void show_goto_trace(
292
292
if (cmdline.isset(" stack-trace" )) \
293
293
options.set_option(" stack-trace" , true );
294
294
295
+ // / Variety of constant expression only used in the context of a GOTO trace, to
296
+ // / give both the numeric value and the symbolic value of a pointer.
297
+ class goto_trace_constant_pointer_exprt : public constant_exprt
298
+ {
299
+ public:
300
+ const exprt &symbolic_pointer () const
301
+ {
302
+ return static_cast <const exprt &>(operands ()[0 ]);
303
+ }
304
+ };
305
+
306
+ template <>
307
+ inline bool can_cast_expr<goto_trace_constant_pointer_exprt>(const exprt &base)
308
+ {
309
+ return can_cast_expr<constant_exprt>(base) && base.operands ().size () == 1 ;
310
+ }
311
+
312
+ inline const goto_trace_constant_pointer_exprt &
313
+ to_goto_trace_constant_pointer_expr (const exprt &expr)
314
+ {
315
+ PRECONDITION (can_cast_expr<goto_trace_constant_pointer_exprt>(expr));
316
+ return static_cast <const goto_trace_constant_pointer_exprt &>(expr);
317
+ }
318
+
295
319
#endif // CPROVER_GOTO_PROGRAMS_GOTO_TRACE_H
You can’t perform that action at this time.
0 commit comments