aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/compiler.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/compiler/compiler.go')
-rw-r--r--pkg/compiler/compiler.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go
index 2c4e81b2b..5abc8e2a8 100644
--- a/pkg/compiler/compiler.go
+++ b/pkg/compiler/compiler.go
@@ -44,6 +44,9 @@ type Prog struct {
}
func createCompiler(desc *ast.Description, target *targets.Target, eh ast.ErrorHandler) *compiler {
+ if eh == nil {
+ eh = ast.LoggingHandler
+ }
comp := &compiler{
desc: desc,
target: target,
@@ -73,9 +76,6 @@ func createCompiler(desc *ast.Description, target *targets.Target, eh ast.ErrorH
// Compile compiles sys description.
func Compile(desc *ast.Description, consts map[string]uint64, target *targets.Target, eh ast.ErrorHandler) *Prog {
- if eh == nil {
- eh = ast.LoggingHandler
- }
comp := createCompiler(desc.Clone(), target, eh)
comp.typecheck()
// The subsequent, more complex, checks expect basic validity of the tree,