Merge pull request #2924 from AleoHQ/fix/2918

This commit is contained in:
d0cd 2023-10-19 23:56:07 -04:00 committed by GitHub
commit 3548158d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 23 additions and 18 deletions

View File

@ -551,7 +551,12 @@ impl<'a> CodeGenerator<'a> {
Some(Expression::Identifier(identifier)) => identifier,
_ => unreachable!("If `has_finalize` is true, then the external call must be an identifier."),
};
self.futures.push((future_register, format!("{program_id}/{function_name}")));
// Add the futures register to the list of futures.
self.futures.push((future_register.clone(), format!("{program_id}/{function_name}")));
// Add the future register to the list of destinations.
destinations.push(future_register);
}
// If destination registers were created, write them to the call instruction.

View File

@ -167,7 +167,7 @@ impl<'a> CodeGenerator<'a> {
}
// Write the destination register.
let destination_register = format!("r{}", self.next_register);
write!(async_instruction, " into {};", destination_register).expect("failed to write to string");
writeln!(async_instruction, " into {};", destination_register).expect("failed to write to string");
// Increment the register counter.
self.next_register += 1;
// Add the async instruction to the instructions.

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 665cf74b0b3ec393665a4190f0deb5cc27b729144d29d631f4220caa72e028b8
inlined_ast: 665cf74b0b3ec393665a4190f0deb5cc27b729144d29d631f4220caa72e028b8
dce_ast: 665cf74b0b3ec393665a4190f0deb5cc27b729144d29d631f4220caa72e028b8
bytecode: 4a5b9bc812c50d11f6117c9d8590336028b90c1579cb7c7a4d976f88164cd1ff
bytecode: 34335e40c3ca26e00044d055cc0cb8d262fce1ac49a4940b36b1136e0772d305
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 9c215a0e0395e4806cdc910fbd241b67dc8d8f285b7ae0978dbea576d3fd8d8f
inlined_ast: 5a38955159fffa89fe7526402a42ecd95a2e3be2f77a02316695d2e1b9af8bd7
dce_ast: 5a38955159fffa89fe7526402a42ecd95a2e3be2f77a02316695d2e1b9af8bd7
bytecode: 27e284d5980f04dde72bc47a930450ff519a8aaa537143646929944b47747a1c
bytecode: 799c84f9a28bcdd1cb72269b56baae0905a136fc2d041745fb7ae52c9958b24e
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 9be983f41578bbf73a13dd63cc320b18bdd8a942a47349fd7cd5d46651bbf998
inlined_ast: 9be983f41578bbf73a13dd63cc320b18bdd8a942a47349fd7cd5d46651bbf998
dce_ast: 9be983f41578bbf73a13dd63cc320b18bdd8a942a47349fd7cd5d46651bbf998
bytecode: fcc9eb5b56e8fb4653a31c3e9d4598540d7185c9c7adf843542c0064388a798b
bytecode: ec9d10d78356538cf9f94bc46c20c33001a05100906259e217eeea2cfd0c4a66
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 9c2e79c3607b50ba675d24d4acb46f3ec80c146a66d91f94476bbed50798e3be
inlined_ast: 9c2e79c3607b50ba675d24d4acb46f3ec80c146a66d91f94476bbed50798e3be
dce_ast: 9c2e79c3607b50ba675d24d4acb46f3ec80c146a66d91f94476bbed50798e3be
bytecode: 3accd06ef2a2ee1b63a1163af2c0e3aee2e6be1dcf8c5d74f1bde06375d18cfe
bytecode: 379643d6f93f6040c0bb64ea96345269a23d6fb23fa3eae46ceb8e9ea9c73f9a
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 6f70b04c03328c079ecc07783e9cecb3ea35ec31390c99fc10a176c006233f8b
inlined_ast: 6f70b04c03328c079ecc07783e9cecb3ea35ec31390c99fc10a176c006233f8b
dce_ast: 6f70b04c03328c079ecc07783e9cecb3ea35ec31390c99fc10a176c006233f8b
bytecode: 15c66036fd72e04909188a3513c635e457f5ad52cee97126e4d3fa567b0e72a7
bytecode: 0c73fbf3a08f7b89b82fc3189771704f58740f37c41f9c5aa7aef2a808badf9b
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: d544ffc75f1144ce6a483231c6ed891fe5fcc681ce7764971f3d32f8054b270a
inlined_ast: d544ffc75f1144ce6a483231c6ed891fe5fcc681ce7764971f3d32f8054b270a
dce_ast: d544ffc75f1144ce6a483231c6ed891fe5fcc681ce7764971f3d32f8054b270a
bytecode: dda6c5ec0cf646f489dc2e61393e3923f23613133d891c5fead791688d76d6d9
bytecode: 6e4a8aeaf3eabc361bf427126c0a7f35c64030fb9c8f66e178c7c05bbede1c48
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 504c9959fbd249c0df40f717ebe03af2ae2d0180e5e8047262e57d2e7fdec050
inlined_ast: 504c9959fbd249c0df40f717ebe03af2ae2d0180e5e8047262e57d2e7fdec050
dce_ast: 504c9959fbd249c0df40f717ebe03af2ae2d0180e5e8047262e57d2e7fdec050
bytecode: 669183b6cb01bc7ab08312b8fc587b217951de09547ab1721dd9ed8f849528cf
bytecode: 2560848929684abb429a7de8a2ff0368fa2ea939f25ae84851be67374b652e8e
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: f98cb577bb880e87b7f285a666bdefac42e93dbcca7b207a176266871cf35449
inlined_ast: f98cb577bb880e87b7f285a666bdefac42e93dbcca7b207a176266871cf35449
dce_ast: f98cb577bb880e87b7f285a666bdefac42e93dbcca7b207a176266871cf35449
bytecode: 8c1f079a06fdd75fe40736caee42eaf3ea79af747aeb6a543fa2748f34fb2017
bytecode: bbef5ec539b8616fe91e41c03c8ea6a71dfd3cb9731e634919bc8356e6664594
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: ba6097eb72f1a9139967b8cc7658300ef6391bd1b9fb05242f40f05737cff82b
inlined_ast: ba6097eb72f1a9139967b8cc7658300ef6391bd1b9fb05242f40f05737cff82b
dce_ast: ba6097eb72f1a9139967b8cc7658300ef6391bd1b9fb05242f40f05737cff82b
bytecode: d4f0f718e0a0822e64a5240330e437b2887c10f7c57afd1d49b46d492c70350b
bytecode: 33d8ca1b78918f26980919a4a8b332fb9b375ac476b64636a387fdab715d4ed9
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 043562950648fd96145192afebc99f6c937c3d2e12e504388e5ac43932ecaf4a
inlined_ast: 043562950648fd96145192afebc99f6c937c3d2e12e504388e5ac43932ecaf4a
dce_ast: 043562950648fd96145192afebc99f6c937c3d2e12e504388e5ac43932ecaf4a
bytecode: f9431e5b7f911faf1125efe054453e8f5bd77346b0ffcf3f7c1903f262b92c7b
bytecode: e9bcea998f0ff492fb57deabfcf08c4ed3f854880b595f17c9aa89181feb3764
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: d09795975e822f338ff3f8e68bfc39455e4b96a8e0a2ade32aee224b68ff0b25
inlined_ast: d09795975e822f338ff3f8e68bfc39455e4b96a8e0a2ade32aee224b68ff0b25
dce_ast: d09795975e822f338ff3f8e68bfc39455e4b96a8e0a2ade32aee224b68ff0b25
bytecode: 0a1e627b8dddf241e008fa571fec639310602cf69b6b39fed80ecc37d4519567
bytecode: 10e754c190939dcffa342c5eef2be0dcb73ef1a9b4391a99e963db6dc61bd38a
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 94e0020bf97d4e2de4222dac09f02552dcf9f33c4b679f0404be129147ad9c8e
inlined_ast: 1e49000db9da20b5560ce6c87ba6bf8e94e624fe341b829b10a63bfb647e8124
dce_ast: 1e49000db9da20b5560ce6c87ba6bf8e94e624fe341b829b10a63bfb647e8124
bytecode: 36070221bedc66d7a131cfab436e095aa4a37eaa4df285c78acef0eeae0c13f9
bytecode: 643990908e94b8c16515df0d5dcd64918c17b356ad82d652cd9d6504089c49f0
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: d2202fe4f8b99aa658ea05233dfd9ca2021645a47df7a01f5a7d781f6b751e2c
inlined_ast: d2202fe4f8b99aa658ea05233dfd9ca2021645a47df7a01f5a7d781f6b751e2c
dce_ast: d2202fe4f8b99aa658ea05233dfd9ca2021645a47df7a01f5a7d781f6b751e2c
bytecode: e8a0ee3b704167e636a3dc886aa5c4de1a4f5287fcaef3cdcb03943aa4a652c3
bytecode: d1cb76177aa7ffcdc033855e2696b25791292c7c6b38fdc3c1e145dadc0f838a
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 888b5240508f78bee53ec724f8ddfd6e597ff195e17124fbd0314feff4495559
inlined_ast: 888b5240508f78bee53ec724f8ddfd6e597ff195e17124fbd0314feff4495559
dce_ast: 795c2624ef40b83a85d12ecae86d465ec508f4271824efe7a8ff1052fef946aa
bytecode: 724ec5d0ea99a2915b7be3753f4217bb235a5ebb38f75d9b22abe40b4787d4a1
bytecode: c5e80399ab1edccfae4591f3c38695e9a4129b35ad2cc75238859a2e109a245f
warnings: ""

View File

@ -11,5 +11,5 @@ outputs:
flattened_ast: 7e37a21d0c97eee60638cb1e1fa9dec8d15fa8a54da062e4f3f34a997efcd69d
inlined_ast: 7e37a21d0c97eee60638cb1e1fa9dec8d15fa8a54da062e4f3f34a997efcd69d
dce_ast: 7e37a21d0c97eee60638cb1e1fa9dec8d15fa8a54da062e4f3f34a997efcd69d
bytecode: 9dc079094c2c96443ae2dd36c9644ea1558b59969bafe7d51d646b6cf74f68e4
bytecode: 7598ca95ba8e589482a0d951cae6f2f8571e7ae33ec8f56dbe83077dac5100d4
warnings: ""

View File

@ -11,7 +11,7 @@ outputs:
flattened_ast: 5109c9f62312f616bb3f381a85915b53de1f60221ce12aafb0e55f232e7ac72a
inlined_ast: 5109c9f62312f616bb3f381a85915b53de1f60221ce12aafb0e55f232e7ac72a
dce_ast: 5109c9f62312f616bb3f381a85915b53de1f60221ce12aafb0e55f232e7ac72a
bytecode: 1e66c9ede8e702226a86a9402cb1737dc8a02b285ddf708e3996d57e82e6ee65
bytecode: 75252a5477a2943c07eaf114bef3dd214acbd7184b3118f14786beb8215bfb94
warnings: ""
results:
dubble: