mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Removes inlining of variable's values into && and || expression, as it
sometimes can violate evaluation order. Fixes creation of arrays of arrays of primitives.
This commit is contained in:
parent
bf68cf4b7d
commit
2f2985bb10
|
@ -45,6 +45,14 @@ class OptimizingVisitor implements StatementVisitor, ExprVisitor {
|
|||
|
||||
@Override
|
||||
public void visit(BinaryExpr expr) {
|
||||
switch (expr.getOperation()) {
|
||||
case AND:
|
||||
case OR:
|
||||
resultExpr = expr;
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
expr.getSecondOperand().acceptVisitor(this);
|
||||
Expr b = resultExpr;
|
||||
expr.getFirstOperand().acceptVisitor(this);
|
||||
|
|
|
@ -1149,9 +1149,6 @@ public class Renderer implements ExprVisitor, StatementVisitor, RenderingContext
|
|||
public void visit(NewArrayExpr expr) {
|
||||
try {
|
||||
ValueType type = expr.getType();
|
||||
while (type instanceof ValueType.Array) {
|
||||
type = ((ValueType.Array)type).getItemType();
|
||||
}
|
||||
if (type instanceof ValueType.Primitive) {
|
||||
switch (((ValueType.Primitive)type).getKind()) {
|
||||
case BOOLEAN:
|
||||
|
|
Loading…
Reference in New Issue
Block a user