@@ -180,7 +180,7 @@ module Raw {
180180
181181class TStageInstruction = TRawInstruction or TRawUnreachedInstruction ;
182182
183- predicate hasInstruction ( TRawInstruction instr ) { any ( ) }
183+ predicate hasInstruction ( TStageInstruction instr ) { any ( ) }
184184
185185predicate hasModeledMemoryResult ( Instruction instruction ) { none ( ) }
186186
@@ -368,6 +368,11 @@ private predicate isStrictlyForwardGoto(GotoStmt goto) {
368368
369369Locatable getInstructionAst ( TStageInstruction instr ) {
370370 result = getInstructionTranslatedElement ( instr ) .getAst ( )
371+ or
372+ exists ( IRFunction irFunc |
373+ instr = TRawUnreachedInstruction ( irFunc ) and
374+ result = irFunc .getFunction ( )
375+ )
371376}
372377
373378/** DEPRECATED: Alias for getInstructionAst */
@@ -377,14 +382,22 @@ deprecated Locatable getInstructionAST(TStageInstruction instr) {
377382
378383CppType getInstructionResultType ( TStageInstruction instr ) {
379384 getInstructionTranslatedElement ( instr ) .hasInstruction ( _, getInstructionTag ( instr ) , result )
385+ or
386+ instr instanceof TRawUnreachedInstruction and
387+ result = getVoidType ( )
380388}
381389
382390predicate getInstructionOpcode ( Opcode opcode , TStageInstruction instr ) {
383391 getInstructionTranslatedElement ( instr ) .hasInstruction ( opcode , getInstructionTag ( instr ) , _)
392+ or
393+ instr instanceof TRawUnreachedInstruction and
394+ opcode instanceof Opcode:: Unreached
384395}
385396
386397IRFunctionBase getInstructionEnclosingIRFunction ( TStageInstruction instr ) {
387398 result .getFunction ( ) = getInstructionTranslatedElement ( instr ) .getFunction ( )
399+ or
400+ instr = TRawUnreachedInstruction ( result )
388401}
389402
390403Instruction getPrimaryInstructionForSideEffect ( SideEffectInstruction instruction ) {
0 commit comments