Fix compiler crash.

This commit is contained in:
Nuno Cruces
2023-11-30 15:13:41 +00:00
parent b262f5cd01
commit a9e32fd3f0
4 changed files with 5 additions and 8 deletions

View File

@@ -7,13 +7,9 @@ import (
"github.com/ncruces/go-sqlite3"
_ "github.com/ncruces/go-sqlite3/embed"
"github.com/ncruces/go-sqlite3/ext/statement"
"github.com/tetratelabs/wazero"
)
func Example() {
// This crashes the compiler.
sqlite3.RuntimeConfig = wazero.NewRuntimeConfigInterpreter()
db, err := sqlite3.Open(":memory:")
if err != nil {
log.Fatal(err)

2
go.mod
View File

@@ -5,7 +5,7 @@ go 1.21
require (
github.com/ncruces/julianday v1.0.0
github.com/psanford/httpreadat v0.1.0
github.com/tetratelabs/wazero v1.5.1-0.20231130010520-d01ebff34db8
github.com/tetratelabs/wazero v1.5.0
golang.org/x/sync v0.5.0
golang.org/x/sys v0.15.0
golang.org/x/text v0.14.0

4
go.sum
View File

@@ -2,8 +2,8 @@ github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt
github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g=
github.com/psanford/httpreadat v0.1.0 h1:VleW1HS2zO7/4c7c7zNl33fO6oYACSagjJIyMIwZLUE=
github.com/psanford/httpreadat v0.1.0/go.mod h1:Zg7P+TlBm3bYbyHTKv/EdtSJZn3qwbPwpfZ/I9GKCRE=
github.com/tetratelabs/wazero v1.5.1-0.20231130010520-d01ebff34db8 h1:0LUxnUU9dmbCq7fwC422Bx5ZjdzJJUfw66P1A0/DZcc=
github.com/tetratelabs/wazero v1.5.1-0.20231130010520-d01ebff34db8/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A=
github.com/tetratelabs/wazero v1.5.0 h1:Yz3fZHivfDiZFUXnWMPUoiW7s8tC1sjdBtlJn08qYa0=
github.com/tetratelabs/wazero v1.5.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=

View File

@@ -62,7 +62,8 @@ func (s *Stmt) ClearBindings() error {
// https://sqlite.org/c3ref/step.html
func (s *Stmt) Step() bool {
s.c.checkInterrupt()
r := s.c.call(s.c.api.step, uint64(s.handle))
step := s.c.mod.ExportedFunction("sqlite3_step")
r := s.c.call(step, uint64(s.handle))
switch r {
case _ROW:
return true