Skip to content

Commit

Permalink
Fix gfp result type
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Nak committed Nov 28, 2024
1 parent 868312f commit beeb673
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ impl<'ctx> FuncTranspiler<'ctx> {
let ptr = match item {
ObjectItem::ContractCode(func_ref) => {
let gfp = GetFunctionPtr::new_unchecked(inst_set, func_ref);
self.builder.insert_inst(gfp, Type::I256.to_ptr(m_ctx))
self.builder
.insert_inst(gfp, func_ref.as_ptr_ty(self.builder.ctx()))
}

ObjectItem::GlobalVariable(variable) => {
Expand Down
1 change: 0 additions & 1 deletion test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ set -e
cargo +nightly fmt --all -- --check
cargo clippy --all-features --all-targets -- -D clippy::all
cargo doc --no-deps

cargo test --all-targets
2 changes: 1 addition & 1 deletion test_files/erc20.snap
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func private %Token::__init__() -> unit {
block0:
v1.i256 = evm_caller;
evm_sstore 0.i256 v1;
v2.*i256 = get_function_ptr %Token::runtime::__init__;
v2.*() -> unit = get_function_ptr %Token::runtime::__init__;
v3.i256 = ptr_to_int v2 i256;
v4.i256 = evm_contract_size %Token::runtime::__init__;
evm_code_copy 0.i256 v3 v4;
Expand Down
4 changes: 2 additions & 2 deletions test_files/nested_object.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func private %Contract1::__init__() -> unit {
block0:
v0.i256 = evm_contract_size %Contract1::Contract2::__init__;
v1.i256 = call %Contract1::block4::allocate v0;
v2.*i256 = get_function_ptr %Contract1::Contract2::__init__;
v2.*() -> unit = get_function_ptr %Contract1::Contract2::__init__;
v3.i256 = ptr_to_int v2 i256;
evm_code_copy v1 v3 v0;
v4.i256 = add v1 v0;
Expand All @@ -48,7 +48,7 @@ func private %Contract1::__init__() -> unit {
v10.i256 = evm_create 0.i256 v1 v9;
v11.i256 = evm_contract_size %Contract1::Contract1_deployed::__init__;
v12.i256 = call %Contract1::block4::allocate v11;
v13.*i256 = get_function_ptr %Contract1::Contract1_deployed::__init__;
v13.*() -> unit = get_function_ptr %Contract1::Contract1_deployed::__init__;
v14.i256 = ptr_to_int v13 i256;
evm_code_copy v12 v14 v11;
evm_return v12 v11;
Expand Down

0 comments on commit beeb673

Please sign in to comment.