mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-20 11:46:44 +00:00
Change a bit the implementation of GAS instruction
[Delivers #79942174]
This commit is contained in:
parent
0d679f0c73
commit
00e5afc1a5
3 changed files with 4 additions and 5 deletions
|
|
@ -690,8 +690,7 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
|
|||
|
||||
case Instruction::GAS:
|
||||
{
|
||||
auto value = builder.CreateLoad(gasMeter.getLLVMGasVar());
|
||||
stack.push(value);
|
||||
stack.push(gasMeter.getGas());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,9 +167,9 @@ void GasMeter::checkMemory(llvm::Value* _additionalMemoryInWords, llvm::IRBuilde
|
|||
_builder.CreateCall(m_gasCheckFunc, cost);
|
||||
}
|
||||
|
||||
llvm::GlobalVariable* GasMeter::getLLVMGasVar()
|
||||
llvm::Value* GasMeter::getGas()
|
||||
{
|
||||
return m_gas;
|
||||
m_builder.CreateLoad(m_gas, "gas");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public:
|
|||
/// Generate code that checks the cost of additional memory used by program
|
||||
void checkMemory(llvm::Value* _additionalMemoryInWords, llvm::IRBuilder<>& _builder);
|
||||
|
||||
llvm::GlobalVariable* getLLVMGasVar();
|
||||
llvm::Value* getGas();
|
||||
|
||||
private:
|
||||
/// Cumulative gas cost of a block of instructions
|
||||
|
|
|
|||
Loading…
Reference in a new issue