mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-21 21:09:02 +00:00
interp: make ptrtoint size mismatch a recoverable error
Go 1.26 changed Darwin's rawSyscall/Syscall from assembly stubs to Go wrappers that call variadic rawsyscalln/syscalln. When the interp tries to evaluate syscall.init() at compile time (which calls Getrlimit → rawSyscall → rawsyscalln), it encounters a ptrtoint of a function pointer and fails with 'ptrtoint integer size does not equal pointer size'. Make this a recoverable error so the interp reverts the init interpretation and defers it to runtime, matching the behavior for other uninterpretable init functions.
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ var errInvalidPtrToIntSize = errors.New("interp: ptrtoint integer size does not
|
|||||||
func isRecoverableError(err error) bool {
|
func isRecoverableError(err error) bool {
|
||||||
return err == errIntegerAsPointer || err == errUnsupportedInst ||
|
return err == errIntegerAsPointer || err == errUnsupportedInst ||
|
||||||
err == errUnsupportedRuntimeInst || err == errMapAlreadyCreated ||
|
err == errUnsupportedRuntimeInst || err == errMapAlreadyCreated ||
|
||||||
err == errLoopUnrolled
|
err == errLoopUnrolled || err == errInvalidPtrToIntSize
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrorLine is one line in a traceback. The position may be missing.
|
// ErrorLine is one line in a traceback. The position may be missing.
|
||||||
|
|||||||
Reference in New Issue
Block a user