diff options
author | Damien George <damien.p.george@gmail.com> | 2015-04-20 13:29:31 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-04-20 13:29:31 +0000 |
commit | c8b60f013b9d624a74ad502460f2bc7d00c39644 (patch) | |
tree | 4fdc71a6e6963961e0591b3abc621d672bb1c645 /py/compile.c | |
parent | 2bb5f41611ddc90cf44090e87efd94523580008b (diff) |
py: Make viper codegen raise proper exception (ViperTypeError) on error.
This fixes a long standing problem that viper code generation gave
terrible error messages, and actually no errors on pyboard where
assertions are disabled.
Now all compile-time errors are raised as proper Python exceptions, and
are of type ViperTypeError.
Addresses issue #940.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/compile.c b/py/compile.c index 6dc39b1dc..45217cfe9 100644 --- a/py/compile.c +++ b/py/compile.c @@ -3764,22 +3764,22 @@ mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is case MP_EMIT_OPT_VIPER: #if MICROPY_EMIT_X64 if (emit_native == NULL) { - emit_native = emit_native_x64_new(max_num_labels); + emit_native = emit_native_x64_new(&comp->compile_error, max_num_labels); } comp->emit_method_table = &emit_native_x64_method_table; #elif MICROPY_EMIT_X86 if (emit_native == NULL) { - emit_native = emit_native_x86_new(max_num_labels); + emit_native = emit_native_x86_new(&comp->compile_error, max_num_labels); } comp->emit_method_table = &emit_native_x86_method_table; #elif MICROPY_EMIT_THUMB if (emit_native == NULL) { - emit_native = emit_native_thumb_new(max_num_labels); + emit_native = emit_native_thumb_new(&comp->compile_error, max_num_labels); } comp->emit_method_table = &emit_native_thumb_method_table; #elif MICROPY_EMIT_ARM if (emit_native == NULL) { - emit_native = emit_native_arm_new(max_num_labels); + emit_native = emit_native_arm_new(&comp->compile_error, max_num_labels); } comp->emit_method_table = &emit_native_arm_method_table; #endif |