phalcon/cphalcon — pull request #918 by sjinks (2013-07-25 02:18:15+00:00)
Title: [BUG] phalcon_fetch_params() restores too many stack frames

If a method is called with too many or too few arguments, `phalcon_fetch_parameters()` throws an exception, restores the topmost memory frame and returns FAILURE. phalcon_fetch_params() notices FAILURE and attempts to restore someone else's stack frame. Which, of course, may lead to very interesting crashes :-)

Dev version will show smth like this:
```
WARNING: calling phalcon_memory_restore_stack() without an active memory frame!
#0 0x7fefcaee98db [/home/vladimir/.phpenv/versions/5.3.26/lib/php/extensions/debug-zts-20090626/phalcon.so(phalcon_print_backtrace+0x2f) [0x7fefcaee98db]]
#1 0x7fefcaf04473 [/home/vladimir/.phpenv/versions/5.3.26/lib/php/extensions/debug-zts-20090626/phalcon.so(phalcon_memory_restore_stack+0x74) [0x7fefcaf04473]]
#2 0x7fefcb0f27a4 [/home/vladimir/.phpenv/versions/5.3.26/lib/php/extensions/debug-zts-20090626/phalcon.so(zim_Phalcon_Escaper_escapeJs+0x66) [0x7fefcb0f27a4]]
#3 0xb0069f [php() [0xb0069f]]
#4 0xb01112 [php() [0xb01112]]
#5 0xaff5b0 [php(execute+0x54f) [0xaff5b0]]
#6 0xac232d [php(zend_execute_scripts+0x2ff) [0xac232d]]
#7 0xa1af98 [php(php_execute_script+0x5c9) [0xa1af98]]
#8 0xbce139 [php() [0xbce139]]
#9 0x7fefd5cf1ea5 [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fefd5cf1ea5]]
#10 0x432429 [php() [0x432429]]
```