comparison src/variables.cc @ 10467:13c1f15c67fa

guard against recursive calls of missing_function_hook
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 26 Mar 2010 08:24:04 +0100
parents 537d9fbba9c0
children 4d1fc073fbb7
comparison
equal deleted inserted replaced
10466:c0c24219fccf 10467:13c1f15c67fa
2392 2392
2393 void maybe_missing_function_hook (const std::string& name) 2393 void maybe_missing_function_hook (const std::string& name)
2394 { 2394 {
2395 // Don't do this if we're handling errors. 2395 // Don't do this if we're handling errors.
2396 if (buffer_error_messages == 0 && ! Vmissing_function_hook.empty ()) 2396 if (buffer_error_messages == 0 && ! Vmissing_function_hook.empty ())
2397 feval (Vmissing_function_hook, octave_value (name)); 2397 {
2398 } 2398 // Ensure auto-restoration.
2399 unwind_protect frame;
2400 frame.protect_var (Vmissing_function_hook);
2401
2402 // Clear the variable prior to calling the function.
2403 const std::string func_name = Vmissing_function_hook;
2404 Vmissing_function_hook.clear ();
2405
2406 // Call.
2407 feval (func_name, octave_value (name));
2408 }
2409 }