From 37559fee214839d08633b73799bd7c60cec16b70 Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 19 Jun 2008 10:39:12 +0000 Subject: [PATCH] make fgfs abort() after a listener with runtime arg == -1 was triggered and its function called. This is useful for debugging purposes, to get a core dump which unveils which C++ code was writing to the property. This isn't any more of a security problem as other Nasal code that makes fgfs crash, such as: var x = func call(x); x(); The difference is that the listener doesn't use up all memory before and is much quicker. --- src/Scripting/NasalSys.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 84429c700..a37c40b35 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -1023,6 +1023,7 @@ void FGNasalListener::valueChanged(SGPropertyNode* node) if(_type < 2 && node != _node) return; // skip child events if(_type > 0 || changed(_node) || _first_call) call(node, naNum(0)); + if(_type == -1) abort(); _first_call = false; }