diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-06-03 22:46:00 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-06-04 20:55:30 +0200 |
commit | b2a78b3ab536658f79e4396201c730a8408d3dd2 (patch) | |
tree | 983d420b6258a1ae9eb7683a27a6c378cc389103 /src | |
parent | a112422e91018b7f01add6c9d40bec5eb010c321 (diff) | |
download | scala-b2a78b3ab536658f79e4396201c730a8408d3dd2.tar.gz scala-b2a78b3ab536658f79e4396201c730a8408d3dd2.tar.bz2 scala-b2a78b3ab536658f79e4396201c730a8408d3dd2.zip |
Fix aliasing / nullness of CHECKCAST
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/analysis/InstructionStackEffect.scala | 5 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzer.scala | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/InstructionStackEffect.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/InstructionStackEffect.scala index a7d6f74557..98e93c125b 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/InstructionStackEffect.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/InstructionStackEffect.scala @@ -249,9 +249,8 @@ object InstructionStackEffect { case ATHROW => t(1, 0) // Frame.execute consumes one stack value - case CHECKCAST => t(0, 0) - - case INSTANCEOF => t(1, 1) + case CHECKCAST | + INSTANCEOF => t(1, 1) // Frame.execute does push(pop()) for both of them case MONITORENTER | MONITOREXIT => t(1, 0) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzer.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzer.scala index 2cc6d67a3c..31710dcbee 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzer.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzer.scala @@ -179,6 +179,8 @@ final class NullnessInterpreter extends Interpreter[NullnessValue](Opcodes.ASM5) def copyOperation(insn: AbstractInsnNode, value: NullnessValue): NullnessValue = value def unaryOperation(insn: AbstractInsnNode, value: NullnessValue): NullnessValue = (insn.getOpcode: @switch) match { + case Opcodes.CHECKCAST => value + case Opcodes.NEWARRAY | Opcodes.ANEWARRAY => NullnessValue(NotNull, isSize2 = false) |