Ticket #362 (closed task: fixed)

Opened 2 weeks ago

Last modified 2 weeks ago

Empty {{{do end}}} block

Reported by: zsejki Owned by: jmaessen
Priority: minor Milestone:
Component: codegen Version:
Keywords: Cc:

Description

If I define a function like this:

f(): () = do
    (*) empty
end

I get:

java.lang.VerifyError: (class: Main, method: f signature: ()Lcom/sun/fortress/compiler/runtimeValues/FVoid;) Unable to pop operand off an empty stack
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:247)
	at com.sun.fortress.runtimeSystem.MainWrapper.main(MainWrapper.java:65)
...

If I do this:

f(): () = do
    do (*empty*) end
    println "f()"
end

I get:

java.lang.Error: 
/Users/me/Code/workspace/Fort/Main.fss:9:11-13:2: Error trying to close method scope.
	at com.sun.fortress.compiler.codegen.CodeGen.generateActualMethodCode(CodeGen.java:976)
	at com.sun.fortress.compiler.codegen.CodeGen.generateFunctionalBody(CodeGen.java:852)
	at com.sun.fortress.compiler.codegen.CodeGen.forFnDecl(CodeGen.java:1091)
	at com.sun.fortress.nodes.FnDecl.accept(FnDecl.java:71)
	at com.sun.fortress.compiler.codegen.CodeGen.forComponent(CodeGen.java:635)
	at com.sun.fortress.nodes.Component.accept(Component.java:56)
	at com.sun.fortress.compiler.phases.CodeGenerationPhase.execute(CodeGenerationPhase.java:108)
	at com.sun.fortress.compiler.phases.Phase.run(Phase.java:58)
	at com.sun.fortress.Shell.analyze(Shell.java:1222)
	at com.sun.fortress.repository.GraphRepository.parseComponent(GraphRepository.java:766)
	at com.sun.fortress.repository.GraphRepository.refreshGraph(GraphRepository.java:485)
	at com.sun.fortress.repository.GraphRepository.getComponent(GraphRepository.java:192)
	at com.sun.fortress.repository.GraphRepository.getLinkedComponent(GraphRepository.java:846)
	at com.sun.fortress.Shell.compilerPhases(Shell.java:910)
	at com.sun.fortress.Shell.compileWithErrorHandling(Shell.java:842)
	at com.sun.fortress.Shell.link(Shell.java:1008)
	at com.sun.fortress.Shell.subMain(Shell.java:382)
	at com.sun.fortress.Shell.main(Shell.java:337)
...

Change History

Changed 2 weeks ago by jmaessen

  • owner changed from dr2chase to jmaessen

Changed 2 weeks ago by jmaessen

  • status changed from new to assigned

Changed 2 weeks ago by jmaessen

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r4318.

Note: See TracTickets for help on using tickets.