Commit 5a8498948d2a6b95d812e63f27db060e126c9bdd
1 parent
44d1b343
Fix anubis compiler crash under Linux
Showing
1 changed file
with
9 additions
and
5 deletions
Show diff stats
anubis_dev/compiler/src/compile.c
| ... | ... | @@ -1829,7 +1829,7 @@ Expr compile_term(Expr head, |
| 1829 | 1829 | { |
| 1830 | 1830 | Expr args = reverse(cdr3(head)); /* arguments in reverse order (a_k,...,a_1) */ |
| 1831 | 1831 | int k = length(args); /* number of arguments */ |
| 1832 | - int op_instance_id; | |
| 1832 | + int op_instance_id = 0; | |
| 1833 | 1833 | Expr args_codes = nil; /* code for computing arguments */ |
| 1834 | 1834 | |
| 1835 | 1835 | Expr f_code = nil; /* code for function */ |
| ... | ... | @@ -1852,13 +1852,17 @@ Expr compile_term(Expr head, |
| 1852 | 1852 | (operation ...) and if the operation instance has no inline code. */ |
| 1853 | 1853 | |
| 1854 | 1854 | /* determine if f is inline or offline */ |
| 1855 | - if (car(third(head)) == operation && | |
| 1856 | - (f_code = | |
| 1857 | - compiled_ops[op_instance_id = | |
| 1855 | + if (car(third(head)) == operation) | |
| 1856 | + { | |
| 1857 | + op_instance_id = | |
| 1858 | 1858 | get_op_instance_id(second(third(head)), |
| 1859 | 1859 | integer_value(third(third(head))), |
| 1860 | 1860 | fifth(third(head)), |
| 1861 | - env)].inline_code) == nil) | |
| 1861 | + env); | |
| 1862 | + f_code = | |
| 1863 | + compiled_ops[op_instance_id].inline_code; | |
| 1864 | + } | |
| 1865 | + if (car(third(head)) == operation && f_code == nil) | |
| 1862 | 1866 | { |
| 1863 | 1867 | /* the function is offline. The code is: |
| 1864 | 1868 | ... | ... |