[Delivers #79942174]
@ -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