Skip to content

Commit 0d5cffd

Browse files
author
Cedric
committed
disable exit symbol
1 parent 2600a6d commit 0d5cffd

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

compiler/compiler/compiler.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import (
1515
"errors"
1616

1717
"github.com/llir/llvm/ir"
18-
"github.com/llir/llvm/ir/constant"
19-
llvmTypes "github.com/llir/llvm/ir/types"
2018
llvmValue "github.com/llir/llvm/ir/value"
2119
)
2220

@@ -374,7 +372,7 @@ func (c *Compiler) panic(block *ir.Block, message string) {
374372
globMsg := c.module.NewGlobalDef(strings.NextStringName(), strings.Constant("runtime panic: "+message+"\n"))
375373
globMsg.Immutable = true
376374
block.NewCall(c.osFuncs.Printf.Value.(llvmValue.Named), strings.Toi8Ptr(block, globMsg))
377-
block.NewCall(c.osFuncs.Exit.Value.(llvmValue.Named), constant.NewInt(llvmTypes.I32, 1))
375+
// block.NewCall(c.osFuncs.Exit.Value.(llvmValue.Named), constant.NewInt(llvmTypes.I32, 1))
378376
}
379377

380378
type Panic string

compiler/compiler/external_funcs.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ func (c *Compiler) createExternalPackage() {
8787
ir.NewParam("", i64.LLVM()),
8888
), false)
8989

90-
c.osFuncs.Exit = setExternal("exit", c.module.NewFunc("exit",
91-
llvmTypes.Void,
92-
ir.NewParam("", i32.LLVM()),
93-
), false)
90+
// c.osFuncs.Exit = setExternal("exit", c.module.NewFunc("exit",
91+
// llvmTypes.Void,
92+
// ir.NewParam("", i32.LLVM()),
93+
// ), false)
9494

9595
c.packages["debug"] = external
9696
}

0 commit comments

Comments
 (0)