From 5a8498948d2a6b95d812e63f27db060e126c9bdd Mon Sep 17 00:00:00 2001 From: Cédric Ricard Date: Tue, 30 Aug 2011 15:30:12 +0000 Subject: [PATCH] Fix anubis compiler crash under Linux --- anubis_dev/compiler/src/compile.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/anubis_dev/compiler/src/compile.c b/anubis_dev/compiler/src/compile.c index 1ca8339..1655ca5 100644 --- a/anubis_dev/compiler/src/compile.c +++ b/anubis_dev/compiler/src/compile.c @@ -1829,7 +1829,7 @@ Expr compile_term(Expr head, { Expr args = reverse(cdr3(head)); /* arguments in reverse order (a_k,...,a_1) */ int k = length(args); /* number of arguments */ - int op_instance_id; + int op_instance_id = 0; Expr args_codes = nil; /* code for computing arguments */ Expr f_code = nil; /* code for function */ @@ -1852,13 +1852,17 @@ Expr compile_term(Expr head, (operation ...) and if the operation instance has no inline code. */ /* determine if f is inline or offline */ - if (car(third(head)) == operation && - (f_code = - compiled_ops[op_instance_id = + if (car(third(head)) == operation) + { + op_instance_id = get_op_instance_id(second(third(head)), integer_value(third(third(head))), fifth(third(head)), - env)].inline_code) == nil) + env); + f_code = + compiled_ops[op_instance_id].inline_code; + } + if (car(third(head)) == operation && f_code == nil) { /* the function is offline. The code is: -- libgit2 0.21.4