grmartin / stab-language

Automatically exported from code.google.com/p/stab-language
Apache License 2.0
0 stars 0 forks source link

if statement with false expression throws NullPointerException #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The following code is throw a NullPointerException:

public class Main {

   public static void main( String[] args){
        if(false){
            System.out.println("INFINITY");
        }
        System.out.println("DONE");
   }
}

Exception in thread "main" java.lang.NullPointerException
        at stab.tools.syntaxtree.StatementHandler.handleStatement(StatementHandler.stab:29)
        at stab.tools.compiler.ReachabilityChecker.handleIf(ReachabilityChecker.stab:437)
        at stab.tools.compiler.ReachabilityChecker.handleIf(ReachabilityChecker.stab)
        at stab.tools.syntaxtree.StatementHandler.handleStatement(StatementHandler.stab:61)
        at stab.tools.compiler.ReachabilityChecker.visitStatement(ReachabilityChecker.stab:717)
        at stab.tools.compiler.ReachabilityChecker.visitStatements(ReachabilityChecker.stab:696)
        at stab.tools.compiler.ReachabilityChecker.handleBlock(ReachabilityChecker.stab:132)
        at stab.tools.compiler.ReachabilityChecker.handleBlock(ReachabilityChecker.stab)
        at stab.tools.syntaxtree.StatementHandler.handleStatement(StatementHandler.stab:31)
        at stab.tools.compiler.ReachabilityChecker.checkMethod(ReachabilityChecker.stab:96)
        at stab.tools.compiler.Compiler.validateControlFlow(Compiler.stab:2922)
        at stab.tools.compiler.Compiler.validateClassMethodCode(Compiler.stab:2870)
        at stab.tools.compiler.Compiler.validateClassCode(Compiler.stab:2566)
        at stab.tools.compiler.Compiler.validateCode(Compiler.stab:2508)
        at stab.tools.compiler.Compiler.validateCode(Compiler.stab:2525)
        at stab.tools.compiler.Compiler.validateCode(Compiler.stab:2505)
        at stab.tools.compiler.Compiler.validateCode(Compiler.stab:2474)
        at stab.tools.compiler.Compiler.doCompile(Compiler.stab:205)
        at stab.tools.compiler.Compiler.compileFromFiles(Compiler.stab:158)
        at stab.tools.compiler.Application.run(Application.stab:128)
        at stab.tools.compiler.Application.main(Application.stab:30)

Original issue reported on code.google.com by ice.ta...@gmail.com on 3 Jul 2010 at 1:48

GoogleCodeExporter commented 8 years ago
Fixed.

Original comment by stab.hac...@gmail.com on 4 Jul 2010 at 10:12