diff options
author | Matthias Zenger <mzenger@gmail.com> | 2003-09-24 12:58:33 +0000 |
---|---|---|
committer | Matthias Zenger <mzenger@gmail.com> | 2003-09-24 12:58:33 +0000 |
commit | 51a5386fa3225c117633ea7171760590d01bf6f3 (patch) | |
tree | b641d674fa84e9daa09629d00cf408212ba6f88f /sources/scalac/backend | |
parent | 7af685862e96ec739fdf843dac4277b0edaccf19 (diff) | |
download | scala-51a5386fa3225c117633ea7171760590d01bf6f3.tar.gz scala-51a5386fa3225c117633ea7171760590d01bf6f3.tar.bz2 scala-51a5386fa3225c117633ea7171760590d01bf6f3.zip |
Bugfixes.
Diffstat (limited to 'sources/scalac/backend')
-rw-r--r-- | sources/scalac/backend/jvm/GenJVM.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java index 6d5d5d6329..7c38224780 100644 --- a/sources/scalac/backend/jvm/GenJVM.java +++ b/sources/scalac/backend/jvm/GenJVM.java @@ -492,6 +492,8 @@ class GenJVM { break; case Literal(Object value): + // MZ: I added the missing cases, but I am not sure if this + // is a good idea (in particular the way generatedType is set) if (value instanceof Integer) { generatedType = JType.INT; ctx.code.emitPUSH((Integer)value); @@ -757,8 +759,17 @@ class GenJVM { int arity = args.length; int resTypeIdx = getTypeIndex(resType); - for (int i = 0; i < arity; ++i) - genLoad(ctx, args[i], resType); + // MZ: This code looks very dangerous; why are arguments + // loaded with an expected type that corresponds to resType? + // At least for the long shift instructions this is wrong. + if ((prim == Primitive.LSL) || + (prim == Primitive.LSR) || + (prim == Primitive.ASR)) { + genLoad(ctx, args[0], resType); + genLoad(ctx, args[1], JType.INT); + } else + for (int i = 0; i < arity; ++i) + genLoad(ctx, args[i], resType); if (prim == Primitive.NOT) { if (resType == JType.LONG) { |