Merge pull request #1796 from nspcc-dev/compiler/pow

Add syscalls for POW and SQRT opcodes
This commit is contained in:
Roman Khimov 2021-03-04 16:56:15 +03:00 committed by GitHub
commit 924de3e090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 226 additions and 37 deletions

View file

@ -292,7 +292,8 @@ func isSyscall(fun *funcScope) bool {
if fun.selector == nil || fun.pkg == nil || !isInteropPath(fun.pkg.Path()) {
return false
}
return fun.pkg.Name() == "neogointernal" && strings.HasPrefix(fun.name, "Syscall")
return fun.pkg.Name() == "neogointernal" && (strings.HasPrefix(fun.name, "Syscall") ||
strings.HasPrefix(fun.name, "Opcode"))
}
const interopPrefix = "github.com/nspcc-dev/neo-go/pkg/interop"
@ -330,6 +331,5 @@ func canInline(s string) bool {
return false
}
return !strings.HasPrefix(s[len(interopPrefix):], "/neogointernal") &&
!strings.HasPrefix(s[len(interopPrefix):], "/util") &&
!strings.HasPrefix(s[len(interopPrefix):], "/convert")
!strings.HasPrefix(s[len(interopPrefix):], "/util")
}