Advertisement
Guest User

Untitled

a guest
Aug 7th, 2020
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. @NikiC Getting a weird new segfault now in case I have more arguments to a function that it wanted. I used to have:
  2.  
  3. if ((i < arguments_wanted) || ((zdata->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) && (i < arguments_sent))) {
  4. if (ZEND_CALL_ARG(zdata, fse->varc+1)) {
  5. ZVAL_COPY(&(fse->var[fse->varc].data), ZEND_CALL_ARG(zdata, fse->varc+1));
  6. }
  7. } else {
  8. ZVAL_COPY(&(fse->var[fse->varc].data), ZEND_CALL_VAR_NUM(zdata, zdata->func->op_array.last_var + zdata->func->op_array.T + i - arguments_wanted));
  9. }
  10.  
  11. With i being 2 and arguments wanted being 1, for the following code:
  12.  
  13. class Test {
  14. public function __construct() { }
  15. public function __call($func, $args) {
  16. return $this->$func($args);
  17. }
  18. private function testFunc($args) {
  19. array_sum($args);
  20. }
  21.  
  22. But that now segfaults, because ZEND_CALL_ARG no longer returns "NULL" here.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement