mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-26 07:49:28 +01:00
ignore reuse variable
This commit is contained in:
parent
29ec5ace04
commit
babff867ae
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2011 - 2017 Volker Berlin (i-net software)
|
Copyright 2011 - 2018 Volker Berlin (i-net software)
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -58,13 +58,17 @@ public class LocalVariableTable {
|
|||||||
table = new LocalVariable[count];
|
table = new LocalVariable[count];
|
||||||
tablePosition = new LocalVariable[count];
|
tablePosition = new LocalVariable[count];
|
||||||
}
|
}
|
||||||
|
boolean[] wasSet = new boolean[table.length];
|
||||||
for( int i = 0; i < count; i++ ) {
|
for( int i = 0; i < count; i++ ) {
|
||||||
LocalVariable var = new LocalVariable( input, i );
|
LocalVariable var = new LocalVariable( input, i );
|
||||||
int idx = var.getIndex();
|
int idx = var.getIndex();
|
||||||
if( withPositions ) {
|
if( withPositions ) {
|
||||||
tablePosition[i] = var;
|
tablePosition[i] = var;
|
||||||
}
|
}
|
||||||
table[idx] = var;
|
if( !wasSet[idx] ) { // does not use index of reused variable
|
||||||
|
table[idx] = var;
|
||||||
|
wasSet[idx] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user