]> git.mxchange.org Git - flightgear.git/commitdiff
make fgfs abort() after a listener with runtime arg == -1 was triggered
authormfranz <mfranz>
Thu, 19 Jun 2008 10:39:12 +0000 (10:39 +0000)
committermfranz <mfranz>
Thu, 19 Jun 2008 10:39:12 +0000 (10:39 +0000)
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

index 84429c70096bc0982a785ece974e5cc558bcbb7f..a37c40b35d87f82260f6a3bf7ca826d0b82a59f9 100644 (file)
@@ -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;
 }