aboutsummaryrefslogtreecommitdiff
path: root/src/lux/compiler/case.clj
diff options
context:
space:
mode:
authorEduardo Julian2015-10-27 14:44:26 -0400
committerEduardo Julian2015-10-27 14:44:26 -0400
commit95db55b06d4dc8dbd167ec6f47be4afccb88da92 (patch)
tree8486077ec5d21cc72e323c9e550e77e2a9b3c009 /src/lux/compiler/case.clj
parentafb338bc42d631caedf80d5dd7affb8f6d604f86 (diff)
- Storage instructions during pattern matching when doing aliasing now use the -1 index to signal no-op.
- Removed unnecessary debugging logging.
Diffstat (limited to '')
-rw-r--r--src/lux/compiler/case.clj10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lux/compiler/case.clj b/src/lux/compiler/case.clj
index 20c90d661..61209b7fb 100644
--- a/src/lux/compiler/case.clj
+++ b/src/lux/compiler/case.clj
@@ -26,9 +26,13 @@
(defn ^:private compile-match [^MethodVisitor writer ?match $target $else]
(|case ?match
(&a-case/$StoreTestAC ?idx)
- (doto writer
- (.visitVarInsn Opcodes/ASTORE ?idx)
- (.visitJumpInsn Opcodes/GOTO $target))
+ (if (< ?idx 0)
+ (doto writer
+ (.visitInsn Opcodes/POP) ;; Basically, a No-Op
+ (.visitJumpInsn Opcodes/GOTO $target))
+ (doto writer
+ (.visitVarInsn Opcodes/ASTORE ?idx)
+ (.visitJumpInsn Opcodes/GOTO $target)))
(&a-case/$BoolTestAC ?value)
(doto writer