diff options
author | Damien George <damien.p.george@gmail.com> | 2015-07-23 14:30:37 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-07-23 14:30:37 +0100 |
commit | f17e663493c80e2b9b9dbc8b6340c9239efc92a0 (patch) | |
tree | 0b7435e63de215ea2d556f5f816c2e0176b19f9b /py/emitnative.c | |
parent | e45c1dbd6f4e313f21862c853d55499447c844e6 (diff) |
py: Issue an error when compiling Viper functions with more than 4 args.
Otherwise it can be very hard to track down bugs.
Diffstat (limited to 'py/emitnative.c')
-rw-r--r-- | py/emitnative.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/emitnative.c b/py/emitnative.c index 0d3f78da4..37dbd56b3 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -675,6 +675,12 @@ STATIC void emit_native_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scop if (emit->do_viper_types) { + // right now we have a restriction of maximum of 4 arguments + if (scope->num_pos_args >= 5) { + EMIT_NATIVE_VIPER_TYPE_ERROR(emit, "Viper functions don't currently support more than 4 arguments (while compiling '%q')", scope->simple_name); return; + return; + } + // entry to function int num_locals = 0; if (pass > MP_PASS_SCOPE) { |