Created
April 16, 2014 22:44
-
-
Save tstarling/10939962 to your computer and use it in GitHub Desktop.
lol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (*type_spec == '*' || *type_spec == '+') { | |
int num_varargs = num_args + 1 - post_varargs; | |
/* eat up the passed in storage even if it won't be filled in with varargs */ | |
varargs = va_arg(*va, zval ****); | |
n_varargs = va_arg(*va, int *); | |
type_spec++; | |
if (num_varargs > 0) { | |
int iv = 0; | |
auto tmp = ZendExecutionStack::getArg(i); | |
zval **p = &tmp; | |
*n_varargs = num_varargs; | |
/* allocate space for array and store args */ | |
*varargs = (zval ***) safe_emalloc(num_varargs, sizeof(zval **), 0); | |
while (num_varargs-- > 0) { | |
(*varargs)[iv++] = p++; | |
} | |
/* adjust how many args we have left and restart loop */ | |
num_args = num_args + 1 - iv; | |
i += iv; | |
continue; | |
} else { | |
*varargs = NULL; | |
*n_varargs = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment