bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bug #40729] NPE in inline-compiler for AppendValues


From: John Tobey
Subject: [Bug-kawa] [bug #40729] NPE in inline-compiler for AppendValues
Date: Thu, 28 Nov 2013 01:45:42 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:25.0) Gecko/20100101 Firefox/25.0

URL:
  <http://savannah.gnu.org/bugs/?40729>

                 Summary: NPE in inline-compiler for AppendValues
                 Project: Kawa
            Submitted by: jtobey
            Submitted on: Thu 28 Nov 2013 01:45:41 AM GMT
                Category: Code generation
                Severity: 3 - Normal
              Item Group: Compile-time exception
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I think this could be smaller, but the going is slow.

bug.scm

(define-syntax macro1
  (syntax-rules ()
    ((_ f1 ignored)
     (define f1
       (call-with-values
           (lambda ()
             (define (f1 f2)
               (f2))
             (values f1))
         (lambda (x) x))))))

(define-syntax macro2
  (syntax-rules ()
    ((_ f5)
     (let ()
       (macro1 f1 (lambda (x) (f5)))
       (define (f3)
         (define (f4) #f)
         (f1 f4))
       f3))))

(define f (macro2 (lambda () #f)))



$ kawa -C bug.scm
(compiling bug.scm to bug)
bug.scm:19:10: caught exception in inline-compiler for #<procedure
gnu.kawa.functions.AppendValues> - java.lang.NullPointerException
    gnu.expr.LambdaExp.addMethodFor(LambdaExp.java:975)
    gnu.expr.LambdaExp.addMethodFor(LambdaExp.java:873)
    gnu.expr.LambdaExp.allocMethod(LambdaExp.java:1276)
    gnu.expr.ApplyExp.compile(ApplyExp.java:226)
    gnu.expr.ApplyExp.compile(ApplyExp.java:132)
    gnu.expr.Expression.compileNotePosition(Expression.java:156)
    gnu.expr.Expression.compileWithPosition(Expression.java:127)
    gnu.expr.BeginExp.compile(BeginExp.java:153)
    gnu.expr.Expression.compileNotePosition(Expression.java:156)
    gnu.expr.Expression.compileWithPosition(Expression.java:127)
    gnu.expr.LetExp.compile(LetExp.java:193)
    gnu.expr.Expression.compileNotePosition(Expression.java:156)
    gnu.expr.Expression.compileWithPosition(Expression.java:142)
    gnu.expr.LambdaExp.compileBody(LambdaExp.java:1730)
    gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1706)
    gnu.expr.LambdaExp.compileSetField(LambdaExp.java:720)
    gnu.expr.LambdaExp.compile(LambdaExp.java:820)
    gnu.expr.Expression.compileNotePosition(Expression.java:156)
    gnu.expr.Expression.compileWithPosition(Expression.java:127)
    gnu.expr.LetExp.compile(LetExp.java:163)
    gnu.expr.Expression.compileNotePosition(Expression.java:156)
    gnu.expr.Expression.compileWithPosition(Expression.java:127)
    gnu.expr.LetExp.compile(LetExp.java:193)
    gnu.expr.Expression.compile(Expression.java:176)
    gnu.expr.SetExp.compile(SetExp.java:303)
    gnu.expr.Expression.compileNotePosition(Expression.java:156)
    gnu.expr.Expression.compileWithPosition(Expression.java:127)
    gnu.kawa.functions.AppendValues.compile(AppendValues.java:43)
    gnu.expr.ApplyExp.inlineCompile(ApplyExp.java:624)
    gnu.expr.ApplyExp.compile(ApplyExp.java:196)
    gnu.expr.ApplyExp.compile(ApplyExp.java:132)
    gnu.expr.Expression.compileNotePosition(Expression.java:156)
    gnu.expr.Expression.compileWithPosition(Expression.java:142)
    gnu.expr.LambdaExp.compileBody(LambdaExp.java:1730)
    gnu.expr.Compilation.generateBytecode(Compilation.java:2095)
    gnu.expr.Compilation.process(Compilation.java:1972)
    gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:305)
    gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:290)
    kawa.repl.compileFiles(repl.java:806)
    kawa.repl.processArgs(repl.java:430)
    kawa.repl.main(repl.java:852)
internal error while compiling bug.scm
java.lang.Error: popType called with empty stack bug.f3()java.lang.Object
        at gnu.bytecode.CodeAttr.popType(CodeAttr.java:442)
        at gnu.bytecode.CodeAttr.emitRawReturn(CodeAttr.java:2109)
        at gnu.bytecode.CodeAttr.emitReturn(CodeAttr.java:2096)
        at gnu.expr.LambdaExp.compileEnd(LambdaExp.java:606)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2096)
        at gnu.expr.Compilation.process(Compilation.java:1972)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:305)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:290)
        at kawa.repl.compileFiles(repl.java:806)
        at kawa.repl.processArgs(repl.java:430)
        at kawa.repl.main(repl.java:852)






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?40729>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]