Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Nov 16, 2024
1 parent a81f968 commit b92dd68
Show file tree
Hide file tree
Showing 10 changed files with 1,475 additions and 39 deletions.
6 changes: 3 additions & 3 deletions gnovm/stdlibs/math/overflow/overflow.gno
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func Div8p(a, b int8) int8 {
func Quo8(a, b int8) (int8, int8, bool) {
if b == 0 {
return 0, 0, false
} else if b == -1 && a == math.MinInt8 {
} else if b == -1 && a == int8(math.MinInt8) {
return 0, 0, false
}
c := a / b
Expand Down Expand Up @@ -313,7 +313,7 @@ func Div16p(a, b int16) int16 {
func Quo16(a, b int16) (int16, int16, bool) {
if b == 0 {
return 0, 0, false
} else if b == -1 && a == math.MinInt16 {
} else if b == -1 && a == int16(math.MinInt16) {
return 0, 0, false
}
c := a / b
Expand Down Expand Up @@ -403,7 +403,7 @@ func Div32p(a, b int32) int32 {
func Quo32(a, b int32) (int32, int32, bool) {
if b == 0 {
return 0, 0, false
} else if b == -1 && a == math.MinInt32 {
} else if b == -1 && a == int32(math.MinInt32) {
return 0, 0, false
}
c := a / b
Expand Down
32 changes: 32 additions & 0 deletions gnovm/tests/files/zrealm_crossrealm15.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// PKGPATH: gno.land/r/crossrealm_test
package crossrealm_test

import (
"std"

crossrealm "gno.land/r/demo/tests/crossrealm"
)

type fooer struct{}

func (fooer) Foo() { println("hello " + std.CurrentRealm().PkgPath()) }

var f *fooer

func init() {
f = &fooer{}
crossrealm.SetFooer(f)
crossrealm.CallFoo()
}

func main() {
print(".")
}

// Output:
// hello gno.land/r/crossrealm_test
// .

// Error:

// Realm:
Loading

0 comments on commit b92dd68

Please sign in to comment.