Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
case with byte value causes CompilerException
Description
Summary: The Clojure ASM upgrade exposed a regression in ASM. This patch matches the patch being applied to ASM.
Summary: The Clojure ASM upgrade exposed a regression in ASM. This patch matches the patch being applied to ASM.
Approach: Copy the patch being made to ASM https://gitlab.ow2.org/asm/asm/commit/7d045e01cdadad95d62534ef92cb0eca2eec1a17 plus add test
Patch: 0001-CLJ-2367-Incorporate-ASM-merge-request-189-and-add-c.patch
Repro
Clojure 1.10.0-alpha5 fails as follows:
(! 803)-> clj -A:master Downloading: org/clojure/clojure/1.10.0-master-SNAPSHOT/maven-metadata.xml from https://oss.sonatype.org/content/repositories/snapshots/ Clojure 1.10.0-master-SNAPSHOT user=> (case (byte 100) 1 2 3) CompilerException java.lang.IllegalArgumentException, compiling:(NO_SOURCE_PATH:1:1) user=> (pst) CompilerException java.lang.IllegalArgumentException, compiling:(NO_SOURCE_PATH:1:1) clojure.lang.Compiler.analyzeSeq (Compiler.java:7010) clojure.lang.Compiler.analyze (Compiler.java:6773) clojure.lang.Compiler.eval (Compiler.java:7059) clojure.lang.Compiler.eval (Compiler.java:7025) clojure.core/eval (core.clj:3206) clojure.core/eval (core.clj:3202) clojure.main/repl/read-eval-print--8730/fn--8733 (main.clj:243) clojure.main/repl/read-eval-print--8730 (main.clj:243) clojure.main/repl/fn--8739 (main.clj:261) clojure.main/repl (main.clj:261) clojure.main/repl-opt (main.clj:325) clojure.main/main (main.clj:424) Caused by: IllegalArgumentException clojure.asm.commons.GeneratorAdapter.cast (GeneratorAdapter.java:785) clojure.lang.Compiler$CaseExpr.emitExprForInts (Compiler.java:8805) clojure.lang.Compiler$CaseExpr.doEmit (Compiler.java:8728) clojure.lang.Compiler$CaseExpr.emit (Compiler.java:8705) clojure.lang.Compiler$BodyExpr.emit (Compiler.java:6144) clojure.lang.Compiler$LetExpr.doEmit (Compiler.java:6503) clojure.lang.Compiler$LetExpr.emit (Compiler.java:6453) clojure.lang.Compiler$BodyExpr.emit (Compiler.java:6144) clojure.lang.Compiler$ObjMethod.emitBody (Compiler.java:5844) clojure.lang.Compiler$FnMethod.doEmitStatic (Compiler.java:5508) clojure.lang.Compiler$FnMethod.emit (Compiler.java:5473) clojure.lang.Compiler$FnExpr.emitMethods (Compiler.java:3937) nil
Screening Notes: I followed all the discussion/links and concur with the assessment, and that this patch matches the fix being applied to ASM.