mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +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");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -58,13 +58,17 @@ public class LocalVariableTable {
|
||||
table = new LocalVariable[count];
|
||||
tablePosition = new LocalVariable[count];
|
||||
}
|
||||
boolean[] wasSet = new boolean[table.length];
|
||||
for( int i = 0; i < count; i++ ) {
|
||||
LocalVariable var = new LocalVariable( input, i );
|
||||
int idx = var.getIndex();
|
||||
if( withPositions ) {
|
||||
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