From b5530c555f6a7ba81feab09dd490b7ab59703c78 Mon Sep 17 00:00:00 2001 From: Andrew Pilipenko Date: Wed, 30 May 2018 11:33:00 +0000 Subject: [PATCH] Fixed NPE while return from nested function If in doCommand we must go deeper then one level we have NPE in return function. Now it monkey-fixed. --- src/bitlash-instream.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bitlash-instream.c b/src/bitlash-instream.c index dad38f0..510b8d2 100644 --- a/src/bitlash-instream.c +++ b/src/bitlash-instream.c @@ -262,7 +262,12 @@ void returntoparsepoint(parsepoint *p, byte returntoparent) { void returntoparsepoint(parsepoint *p, byte returntoparent) { // restore parse type and location; for script files, pass name from string pool - initparsepoint(p->fetchtype, p->fetchptr, returntoparent ? callername : calleename); + /* + Monkey-patching: returntoparent ? callername : calleename + callername ALWAYS was NULL so this caused crash + So I removed callername completely. All functions now works properly, even complicated: execute("print measure(\"DHT\",\"temp\")") + */ + initparsepoint(p->fetchtype, p->fetchptr, calleename); } #endif