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.

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.

Environment

None

Attachments

2
  • 01 Jul 2018, 02:36 AM
  • 28 Jun 2018, 04:44 AM

Activity

Show:

Daniel SuttonJuly 3, 2018 at 7:27 PM

Sean CorfieldJuly 1, 2018 at 2:36 AM

Updated patch: preserves new case tests, reverts Compiler.java change, incorporates GeneratorAdapter.java changes from their merge request 189.

Sean CorfieldJuly 1, 2018 at 2:33 AM

Sure, I'll update my patch to include the changes from merge_requests/189, revert the Compiler.java change, and still include the new tests.

Alex MillerJune 30, 2018 at 8:39 PM

Would be great if someone could make a patch in the Clojure equivalent version of this code and test...

Daniel SuttonJune 30, 2018 at 5:28 PM

from the ow2 ticket:

> Thanks for your report. The regression was actually introduced by a4b16ab3, and will be fixed with !189.

https://gitlab.ow2.org/asm/asm/merge_requests/189

Completed

Details

Assignee

Reporter

Labels

Approval

Ok

Priority

Affects versions

Fix versions

Created June 28, 2018 at 3:55 AM
Updated July 4, 2018 at 3:52 PM
Resolved July 4, 2018 at 3:52 PM

Flag notifications