-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] Add network.id
and self.address
opcodes
#27917
Changes from all commits
f93d77b
dda608f
3b3d4b4
5a060a4
1e0afc2
7f03816
760fc3c
07a6c84
b85ace8
37d0b0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,7 +273,9 @@ impl StatementReconstructor for Flattener<'_> { | |
let guard = self.construct_guard(); | ||
|
||
match input.expression { | ||
Expression::Unit(_) | Expression::Identifier(_) => self.returns.push((guard, input)), | ||
Expression::Unit(_) | Expression::Identifier(_) | Expression::Access(_) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are accesses required to be added here? Shouldn't SSA create unique assignment statements for access expressions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added it because there was a compiler panic when a return statement contained an access expression. Looks like it might not be processed in SSA to ensure proper CG. https://github.com/AleoHQ/leo/blob/e6ba5069dc115837b1df361099db3db265f75676/compiler/passes/src/static_single_assignment/rename_statement.rs#L359 |
||
self.returns.push((guard, input)) | ||
} | ||
_ => unreachable!("SSA guarantees that the expression is always an identifier or unit expression."), | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,6 +272,8 @@ symbols! { | |
stub, | ||
block, | ||
height, | ||
network, | ||
id, | ||
} | ||
|
||
/// An interned string. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
namespace: Compile | ||
expectation: Pass | ||
outputs: | ||
- - compile: | ||
- initial_symbol_table: f159adcd5ea24c580a6b8535b217667a40173809e5802a0b03db3dc5b9bec9aa | ||
type_checked_symbol_table: 9fd0ee7288d5151305f4cd3820594bd9db7accb589bc936e186709af1df6de21 | ||
unrolled_symbol_table: 9fd0ee7288d5151305f4cd3820594bd9db7accb589bc936e186709af1df6de21 | ||
initial_ast: 21db64864f84959ad71dace62a2487285c3b6bb74818536b83a54b63a2bd8d82 | ||
unrolled_ast: 21db64864f84959ad71dace62a2487285c3b6bb74818536b83a54b63a2bd8d82 | ||
ssa_ast: d4e2a516deaa30f8663bb3cd1501c52e3cc781b330dbb149ee3bad0692a8cb59 | ||
flattened_ast: 175fbd23f91421e3d47440c8a7e00fb9e3a2bef1147e061cd8a3f2bd0c978098 | ||
destructured_ast: a23caa23b3ac10d6c2a1b119af502a9ec4380cf521eb65da2c9e2a5f19d44172 | ||
inlined_ast: a23caa23b3ac10d6c2a1b119af502a9ec4380cf521eb65da2c9e2a5f19d44172 | ||
dce_ast: a23caa23b3ac10d6c2a1b119af502a9ec4380cf521eb65da2c9e2a5f19d44172 | ||
bytecode: d9e6c28f9e5527abe9cdb07b9d35375901446415f5d645b0363597200ee45be7 | ||
errors: "" | ||
warnings: "" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
namespace: Compile | ||
expectation: Pass | ||
outputs: | ||
- - compile: | ||
- initial_symbol_table: 02b83350abcecb36109bf268cf52b9fc867ab1893c49badf31ff527156528943 | ||
type_checked_symbol_table: 1ace971bd20adb9ce07f802070f05c51733af791ef32c7b1130d4a4b2182768d | ||
unrolled_symbol_table: 1ace971bd20adb9ce07f802070f05c51733af791ef32c7b1130d4a4b2182768d | ||
initial_ast: 6dc0a710ab752f571f4dae9fdb172a7fa1c43e3af3858cbc8cf96c5d510a0c3a | ||
unrolled_ast: 6dc0a710ab752f571f4dae9fdb172a7fa1c43e3af3858cbc8cf96c5d510a0c3a | ||
ssa_ast: e09d30595377e81788433b702f76f1338ff4bb720f8564e2560e5f78ebd18bc0 | ||
flattened_ast: 16df732ae63243e249201817b30ae02b8a190072d39894648607970eb2b09192 | ||
destructured_ast: b2f615fbb0825b50c961b4014e2e2d60117b543cab0d2e1acd4f3237c878e95e | ||
inlined_ast: d3f7291df3faf6f8a4893b91133fe183d44c35f3d9c4b9d270d71f943482f965 | ||
dce_ast: d3f7291df3faf6f8a4893b91133fe183d44c35f3d9c4b9d270d71f943482f965 | ||
bytecode: ae04a04e7ffb01dfdd0ae0249f31649302bc120ea928c5ace16bc0879140e1f9 | ||
errors: "" | ||
warnings: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be more "proper" to do the swap in a later pass. That way the parsed AST accurately reflects the input program. A canonicalization pass would be good for this. At the very least, we should add a comment to move this to canonicalization.