summaryrefslogtreecommitdiff
path: root/sources/scalac/backend/jvm/GenJVM.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/backend/jvm/GenJVM.java')
-rw-r--r--sources/scalac/backend/jvm/GenJVM.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java
index a4a134654e..d808131b36 100644
--- a/sources/scalac/backend/jvm/GenJVM.java
+++ b/sources/scalac/backend/jvm/GenJVM.java
@@ -234,14 +234,11 @@ class GenJVM {
ctx.labels.remove(sym);
} break;
- case Block(Tree[] stats): {
+ case Block(Tree[] stats, Tree value): {
int statsNum = stats.length;
- for (int i = 0; i < statsNum - 1; ++i)
+ for (int i = 0; i < stats.length; ++i)
gen(ctx, stats[i]);
- if (statsNum == 0)
- maybeGenLoadUnit(ctx, expectedType);
- else
- genLoad(ctx, stats[stats.length - 1], expectedType);
+ genLoad(ctx, value, expectedType);
generatedType = expectedType;
} break;
@@ -1276,12 +1273,6 @@ class GenJVM {
return args[0];
} else
return tree;
- case Block(Tree[] stats):
- if (stats.length == 2
- && prims.getPrimitive(stats[1].symbol()) == Primitive.BOX) {
- return stats[0];
- } else
- return tree;
default:
return tree;
}