@@ -52,6 +52,24 @@ private module Cached {
52
52
)
53
53
}
54
54
55
+ /** Gets the summary resulting from prepending `step` to this type-tracking summary. */
56
+ cached
57
+ TypeBackTracker prepend ( TypeBackTracker tbt , StepSummary step ) {
58
+ exists ( Boolean hasReturn , string content | tbt = MkTypeBackTracker ( hasReturn , content ) |
59
+ step = LevelStep ( ) and result = tbt
60
+ or
61
+ step = CallStep ( ) and hasReturn = false and result = tbt
62
+ or
63
+ step = ReturnStep ( ) and result = MkTypeBackTracker ( true , content )
64
+ or
65
+ exists ( string p |
66
+ step = LoadStep ( p ) and content = "" and result = MkTypeBackTracker ( hasReturn , p )
67
+ )
68
+ or
69
+ step = StoreStep ( content ) and result = MkTypeBackTracker ( hasReturn , "" )
70
+ )
71
+ }
72
+
55
73
/**
56
74
* Gets the summary that corresponds to having taken a forwards
57
75
* heap and/or intra-procedural step from `nodeFrom` to `nodeTo`.
@@ -365,19 +383,7 @@ class TypeBackTracker extends TTypeBackTracker {
365
383
TypeBackTracker ( ) { this = MkTypeBackTracker ( hasReturn , content ) }
366
384
367
385
/** Gets the summary resulting from prepending `step` to this type-tracking summary. */
368
- TypeBackTracker prepend ( StepSummary step ) {
369
- step = LevelStep ( ) and result = this
370
- or
371
- step = CallStep ( ) and hasReturn = false and result = this
372
- or
373
- step = ReturnStep ( ) and result = MkTypeBackTracker ( true , content )
374
- or
375
- exists ( string p |
376
- step = LoadStep ( p ) and content = "" and result = MkTypeBackTracker ( hasReturn , p )
377
- )
378
- or
379
- step = StoreStep ( content ) and result = MkTypeBackTracker ( hasReturn , "" )
380
- }
386
+ TypeBackTracker prepend ( StepSummary step ) { result = prepend ( this , step ) }
381
387
382
388
/** Gets a textual representation of this summary. */
383
389
string toString ( ) {
0 commit comments