summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>1999-06-03 21:06:03 +0000
committerAndi Gutmans <andi@php.net>1999-06-03 21:06:03 +0000
commit1225d0307b691e7010627b20ecbc693e63faedff (patch)
treede7aec20037063355e31cb072bc7719d0ed8a152
parent0f99eeb29f1381209e5665e9d20e4db90a678477 (diff)
downloadphp-git-1225d0307b691e7010627b20ecbc693e63faedff.tar.gz
- We weren't counting newlines in heredocs. The only place which is still questionable
is when there's a \ followed by a newline but it seems we have a parse error in this case anyways. - Fixed the alloca() macros so that the alloca() #define in win32 mode won't clash with the real win32 alloca().
-rw-r--r--Zend/zend-scanner.l2
-rw-r--r--Zend/zend_execute.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/Zend/zend-scanner.l b/Zend/zend-scanner.l
index 587fbb8278..0b6b00d4b8 100644
--- a/Zend/zend-scanner.l
+++ b/Zend/zend-scanner.l
@@ -1248,6 +1248,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
<ST_IN_SCRIPTING>"<<<"{TABS_AND_SPACES}{LABEL}("\r")?"\n" {
char *s;
+ CG(zend_lineno)++;
CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0);
s = yytext+3;
while ((*s == ' ') || (*s == '\t')) {
@@ -1276,6 +1277,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
int label_len;
unsigned char unput_semicolon;
+ CG(zend_lineno)++;
if (yytext[yyleng-2]=='\r') {
label_len = yyleng-2;
} else {
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 1a6a833439..0cc01e898a 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -807,9 +807,10 @@ static void call_overloaded_function(int arg_count, zval *return_value, HashTabl
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && (WINNT|WIN32))
+# define do_alloca(p) alloca(p)
# define free_alloca(p)
#else
-# define alloca(p) emalloc(p)
+# define do_alloca(p) emalloc(p)
# define free_alloca(p) efree(p)
#endif
@@ -826,7 +827,7 @@ void execute(zend_op_array *op_array ELS_DC)
zend_function *function_being_called=NULL;
zval **object_ptr=NULL;
#if !defined (__GNUC__) || __GNUC__ < 2
- temp_variable *Ts = (temp_variable *) alloca(sizeof(temp_variable)*op_array->T);
+ temp_variable *Ts = (temp_variable *) do_alloca(sizeof(temp_variable)*op_array->T);
#else
temp_variable Ts[op_array->T];
#endif