@@ -146,14 +146,6 @@ int countIndirectionsForCppType(LanguageType langType) {
146146 )
147147}
148148
149- /**
150- * A `CallInstruction` that calls an allocation function such
151- * as `malloc` or `operator new`.
152- */
153- class AllocationInstruction extends CallInstruction {
154- AllocationInstruction ( ) { this .getStaticCallTarget ( ) instanceof Cpp:: AllocationFunction }
155- }
156-
157149private predicate isIndirectionType ( Type t ) { t instanceof Indirection }
158150
159151private predicate hasUnspecifiedBaseType ( Indirection t , Type base ) {
@@ -368,7 +360,7 @@ newtype TBaseSourceVariable =
368360 // Each IR variable gets its own source variable
369361 TBaseIRVariable ( IRVariable var ) or
370362 // Each allocation gets its own source variable
371- TBaseCallVariable ( AllocationInstruction call )
363+ TBaseCallVariable ( CallInstruction call ) { not call . getResultIRType ( ) instanceof IRVoidType }
372364
373365abstract private class AbstractBaseSourceVariable extends TBaseSourceVariable {
374366 /** Gets a textual representation of this element. */
@@ -396,11 +388,11 @@ class BaseIRVariable extends AbstractBaseSourceVariable, TBaseIRVariable {
396388}
397389
398390class BaseCallVariable extends AbstractBaseSourceVariable , TBaseCallVariable {
399- AllocationInstruction call ;
391+ CallInstruction call ;
400392
401393 BaseCallVariable ( ) { this = TBaseCallVariable ( call ) }
402394
403- AllocationInstruction getCallInstruction ( ) { result = call }
395+ CallInstruction getCallInstruction ( ) { result = call }
404396
405397 override string toString ( ) { result = call .toString ( ) }
406398
@@ -504,8 +496,7 @@ private class BaseIRVariableInstruction extends BaseSourceVariableInstruction,
504496 override BaseIRVariable getBaseSourceVariable ( ) { result .getIRVariable ( ) = this .getIRVariable ( ) }
505497}
506498
507- private class BaseAllocationInstruction extends BaseSourceVariableInstruction , AllocationInstruction
508- {
499+ private class BaseCallInstruction extends BaseSourceVariableInstruction , CallInstruction {
509500 override BaseCallVariable getBaseSourceVariable ( ) { result .getCallInstruction ( ) = this }
510501}
511502
0 commit comments