CSC448: Program Analysis I: Does a Block Return Anything? II [91/133] Previous pageContentsNext page

A simple graph algorithm suffices.

Implementation: file:CheckReturns.java

file:test024.hob fails (even if we initialise b):

$ java hobbes.Compile tests/test024.hob 
PHASE: BuildDiagrams
PHASE: CheckReturns
Exception in thread "main" hobbes.checks.CheckException: entry may fail to return
        at hobbes.controlflow.CheckReturns.checkBlock(CheckReturns.java:57)
        at hobbes.controlflow.CheckReturns.checkReturns(CheckReturns.java:40)
        at hobbes.Compile.checkReturns(Compile.java:176)
        at hobbes.Compile.main(Compile.java:90)

Previous pageContentsNext page