Check maximum number of formal arguments.

http://hkdnet.hatenablog.com/entry/2017/02/06/080000 (Japanese)
parent 48e0bbbf
...@@ -666,6 +666,9 @@ lambda_body(codegen_scope *s, node *tree, int blk) ...@@ -666,6 +666,9 @@ lambda_body(codegen_scope *s, node *tree, int blk)
ka = kd = 0; ka = kd = 0;
ba = tree->car->cdr->cdr->cdr->cdr ? 1 : 0; ba = tree->car->cdr->cdr->cdr->cdr ? 1 : 0;
if (ma > 0x1f || oa > 0x1f || pa > 0x1f || ka > 0x1f) {
codegen_error(s, "too many formal arguments");
}
a = ((mrb_aspec)(ma & 0x1f) << 18) a = ((mrb_aspec)(ma & 0x1f) << 18)
| ((mrb_aspec)(oa & 0x1f) << 13) | ((mrb_aspec)(oa & 0x1f) << 13)
| ((ra & 1) << 12) | ((ra & 1) << 12)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment