internal/shaderir: bug fix: wrong argument check on pow

Closes #2304
This commit is contained in:
Hajime Hoshi 2022-09-05 02:35:40 +09:00
parent 1d487be57b
commit 4ade34bc02

View File

@ -617,7 +617,7 @@ func (cs *compileState) parseExpr(block *block, fname string, expr ast.Expr, mar
t = argts[0] t = argts[0]
} }
case shaderir.Atan2, shaderir.Mod, shaderir.Min, shaderir.Max, shaderir.Step, shaderir.Distance, shaderir.Dot, shaderir.Cross, shaderir.Reflect: case shaderir.Atan2, shaderir.Pow, shaderir.Mod, shaderir.Min, shaderir.Max, shaderir.Step, shaderir.Distance, shaderir.Dot, shaderir.Cross, shaderir.Reflect:
// 2 arguments // 2 arguments
if len(args) != 2 { if len(args) != 2 {
cs.addError(e.Pos(), fmt.Sprintf("number of %s's arguments must be 2 but %d", callee.BuiltinFunc, len(args))) cs.addError(e.Pos(), fmt.Sprintf("number of %s's arguments must be 2 but %d", callee.BuiltinFunc, len(args)))