Browse Source

flag bad vastart uses

Quentin Carbonneaux 3 years ago
parent
commit
5cea0c20ee
1 changed files with 2 additions and 0 deletions
  1. 2 0
      parse.c

+ 2 - 0
parse.c

@@ -671,6 +671,8 @@ DoOp:
 		op = Oload;
 	if (op == Talloc1 || op == Talloc2)
 		op = Oalloc;
+	if (op == Ovastart && !curf->vararg)
+		err("cannot use vastart in non-variadic function");
 	if (k >= Ksb)
 		err("size class must be w, l, s, or d");
 	if (op >= NPubOp)