Skip to content

Commit

Permalink
cl: loadImport check recover
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Jun 10, 2022
1 parent 9429306 commit 9c87036
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions cl/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,13 @@ func simplifyGopPackage(pkgPath string) string {
}

func loadImport(ctx *blockCtx, spec *ast.ImportSpec) {
if enableRecover {
defer func() {
if e := recover(); e != nil {
ctx.handleRecover(e)
}
}()
}
var pkg *gox.PkgRef
var pkgPath = toString(spec.Path)
if realPath, kind := checkC2go(pkgPath); kind != c2goInvalid {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ require (
github.com/goplus/c2go v0.7.7
github.com/goplus/gox v1.11.10
github.com/goplus/libc v0.3.9
github.com/goplus/mod v0.9.10
github.com/goplus/mod v0.9.11
github.com/qiniu/x v1.11.5
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ github.com/goplus/gox v1.11.10 h1:fayKhbqgrxbD9qylZknDZVvhtSmkMgtxMd0IwXXhTYI=
github.com/goplus/gox v1.11.10/go.mod h1:gu7fuQF8RmWPZUjd+tEJGuV3m/vOEv0bHrct0x/KatM=
github.com/goplus/libc v0.3.9 h1:1mZngVccEfPlhVa3iVVY7Z0s6Dm4CbO2OiI5x2z46lg=
github.com/goplus/libc v0.3.9/go.mod h1:ewlp1FCnlqDNJtkjNi7DikLMVfUcLaABJjL4z7QnkNU=
github.com/goplus/mod v0.9.10 h1:z7wrTT241dPSGJDeMs5uuqv/5CgXLomhOZGWEAZ+OpE=
github.com/goplus/mod v0.9.10/go.mod h1:NHU13OjeNV3ez1f+R9FLJIlIun0KNSuZb0jnmP3N3o8=
github.com/goplus/mod v0.9.11 h1:4u/Icor2tH9AbnETTHG0gx4T1Aodi10mCu/+U3V+WCE=
github.com/goplus/mod v0.9.11/go.mod h1:NHU13OjeNV3ez1f+R9FLJIlIun0KNSuZb0jnmP3N3o8=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
Expand Down

0 comments on commit 9c87036

Please sign in to comment.