- Speichern einer lokalen Variable unter Verwenung der InstructionFactory
This commit is contained in:
parent
a23f77c337
commit
65a1038574
@ -143,6 +143,10 @@ public class DHBWInstructionFactory extends InstructionFactory{
|
||||
return InstructionFactory.createLoad(bytecodeType, getStoreIndex(variableName));
|
||||
}
|
||||
|
||||
public LocalVariableInstruction createStore(org.apache.commons.bcel6.generic.Type bytecodeType, String variableName) {
|
||||
return InstructionFactory.createStore(bytecodeType, getStoreIndex(variableName));
|
||||
}
|
||||
|
||||
public Integer getStoreIndex(String variableName) {
|
||||
if(storeIndexes.get(variableName) == null){
|
||||
Integer index = storeIndexes.size()+1;
|
||||
|
@ -208,7 +208,7 @@ public class Assign extends Expr
|
||||
}
|
||||
*/
|
||||
//Es wird momentan immer von RefType ausgegangen:
|
||||
il.append(new ASTORE(_factory.getStoreIndex(expr1.get_Name())));
|
||||
il.append(_factory.createStore(expr2.getType().getBytecodeType(cg, rs), expr1.get_Name()));
|
||||
|
||||
return il;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user