Skip to content
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

chore: remove panic from uverse #2626

Merged
merged 4 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gnovm/pkg/gnolang/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ func isReservedName(n Name) bool {

// scans uverse static node for blocknames. (slow)
func isUverseName(n Name) bool {
if n == "panic" {
// panic is not in uverse, as it is parsed as its own statement (PanicStmt)
return true
}
uverseNames := UverseNode().GetBlockNames()
for _, name := range uverseNames {
if name == n {
Expand Down
12 changes: 1 addition & 11 deletions gnovm/pkg/gnolang/uverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,17 +928,7 @@ func UverseNode() *PackageNode {
return
},
)
defNative("panic",
Flds( // params
"err", AnyT(), // args[0]
),
nil, // results
func(m *Machine) {
arg0 := m.LastBlock().GetParams1()
xv := arg0.Deref()
panic(xv.Sprint(m))
},
)
// NOTE: panic is its own statement type, and is not defined as a function.
defNative("print",
Flds( // params
"xs", Vrd(AnyT()), // args[0]
Expand Down
Loading