Skip to content

Commit

Permalink
Go1.18 support
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon-mint committed Mar 20, 2022
1 parent 72278ba commit 691364b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[![Unsafe 100%](https://img.shields.io/badge/unsafe-100%25-orange?style=for-the-badge)](https://pkg.go.dev/unsafe)

# blackmagic
A collection of projects rejected by the community
2 changes: 1 addition & 1 deletion darkruntime/allfuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func AllFuncs() []*runtime.Func {
pclntable := *(*[]byte)(unsafe.Add(m, moduledata_pclntable_off))
for _, f := range ftab {
_ = f.entry // ignore unused
if f.funcoff < uintptr(len(pclntable)) {
if f.funcoff < uint32(len(pclntable)) {
function := (*runtime.Func)(unsafe.Pointer(&pclntable[f.funcoff]))
funcs = append(funcs, function)
}
Expand Down
4 changes: 2 additions & 2 deletions darkruntime/commons.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ var moduledata_ftab_off uintptr = darkreflect.MustGetOffset(moduledata_t, "ftab"
var moduledata_pclntable_off uintptr = darkreflect.MustGetOffset(moduledata_t, "pclntable") // []byte

type functab struct {
entry uintptr
funcoff uintptr
entry uint32
funcoff uint32
}

func Modulesinit()
Expand Down

0 comments on commit 691364b

Please sign in to comment.