Improved thread creation on Linux
This commit is contained in:
@ -26,6 +26,11 @@ func (f *Function) ExpressionToMemory(node *expression.Expression, memory asm.Me
|
||||
return types.AnyPointer, nil
|
||||
}
|
||||
|
||||
if name == "_exit" {
|
||||
f.MemoryLabel(asm.STORE, memory, "_exit")
|
||||
return types.AnyPointer, nil
|
||||
}
|
||||
|
||||
return nil, errors.New(&errors.UnknownIdentifier{Name: name}, f.File, node.Token.Position)
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,23 @@ func (f *Function) Fold(expr *expression.Expression) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
if expr.Token.Kind == token.Period {
|
||||
left := expr.Children[0]
|
||||
leftText := left.Token.Text(f.File.Bytes)
|
||||
right := expr.Children[1]
|
||||
rightText := right.Token.Text(f.File.Bytes)
|
||||
constant, isConst := f.Constants[f.Package+"."+leftText+"."+rightText]
|
||||
|
||||
if !isConst {
|
||||
return nil
|
||||
}
|
||||
|
||||
value, err := f.ToNumber(constant.Value)
|
||||
expr.Value = value
|
||||
expr.IsFolded = true
|
||||
return err
|
||||
}
|
||||
|
||||
canFold := true
|
||||
|
||||
for _, child := range expr.Children {
|
||||
|
Reference in New Issue
Block a user