php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch patch.diff for PCNTL related Bug #73939

Patch version 2017-01-15 02:45 UTC

Return to Bug #73939 | Download this patch
Patch Revisions:

Developer: as@php.net

diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 0733519..a1ac069 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -560,11 +560,6 @@ PHP_RSHUTDOWN_FUNCTION(pcntl)
 	while (PCNTL_G(head)) {
 		sig = PCNTL_G(head);
 		PCNTL_G(head) = sig->next;
-#ifdef HAVE_STRUCT_SIGINFO_T
-		if (sig->siginfo) {
-			zend_array_destroy(sig->siginfo);
-		}
-#endif
 		efree(sig);
 	}
 	while (PCNTL_G(spares)) {
@@ -1379,11 +1374,7 @@ static void pcntl_signal_handler(int signo)
 	psig->next = NULL;
 
 #ifdef HAVE_STRUCT_SIGINFO_T
-	zval user_siginfo;
-	array_init(&user_siginfo);
-	pcntl_siginfo_to_zval(signo, siginfo, &user_siginfo);
-	psig->siginfo = zend_array_dup(Z_ARRVAL(user_siginfo));
-	zval_ptr_dtor(&user_siginfo);
+	psig->siginfo = *siginfo;
 #endif
 
 	/* the head check is important, as the tick handler cannot atomically clear both
@@ -1428,14 +1419,14 @@ void pcntl_signal_dispatch()
 	PCNTL_G(head) = NULL; /* simple stores are atomic */
 
 	/* Allocate */
-
 	while (queue) {
 		if ((handle = zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo)) != NULL) {
 			if (Z_TYPE_P(handle) != IS_LONG) {
 				ZVAL_NULL(&retval);
 				ZVAL_LONG(&params[0], queue->signo);
 #ifdef HAVE_STRUCT_SIGINFO_T
-				ZVAL_ARR(&params[1], queue->siginfo);
+				array_init(&params[1]);
+				pcntl_siginfo_to_zval(queue->signo, &queue->siginfo, &params[1]);
 #else
 				ZVAL_NULL(&params[1]);
 #endif
diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h
index 865c496..1b13fb0 100644
--- a/ext/pcntl/php_pcntl.h
+++ b/ext/pcntl/php_pcntl.h
@@ -77,7 +77,7 @@ struct php_pcntl_pending_signal {
 	struct php_pcntl_pending_signal *next;
 	zend_long signo;
 #ifdef HAVE_STRUCT_SIGINFO_T
-	zend_array *siginfo;
+	siginfo_t siginfo;
 #endif
 };
 
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 8545861..7429ac07 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.16 */
 #line 1 "ext/pdo/pdo_sql_parser.re"
 /*
   +----------------------------------------------------------------------+
@@ -54,13 +54,12 @@ static int scan(Scanner *s)
 #line 55 "ext/pdo/pdo_sql_parser.c"
 {
 	YYCTYPE yych;
-
 	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
 	yych = *YYCURSOR;
 	switch (yych) {
 	case 0x00:	goto yy2;
-	case '"':	goto yy3;
-	case '\'':	goto yy5;
+	case '"':	goto yy6;
+	case '\'':	goto yy8;
 	case '(':
 	case ')':
 	case '*':
@@ -69,25 +68,64 @@ static int scan(Scanner *s)
 	case '.':	goto yy9;
 	case '-':	goto yy10;
 	case '/':	goto yy11;
-	case ':':	goto yy6;
-	case '?':	goto yy7;
-	default:	goto yy12;
+	case ':':	goto yy12;
+	case '?':	goto yy13;
+	default:	goto yy3;
 	}
 yy2:
 	YYCURSOR = YYMARKER;
-	goto yy4;
+	goto yy7;
 yy3:
+	++YYCURSOR;
+	if (YYLIMIT <= YYCURSOR) YYFILL(1);
+	yych = *YYCURSOR;
+	switch (yych) {
+	case 0x00:
+	case '"':
+	case '\'':
+	case '(':
+	case ')':
+	case '*':
+	case '+':
+	case ',':
+	case '-':
+	case '.':
+	case '/':
+	case ':':
+	case '?':	goto yy5;
+	default:	goto yy3;
+	}
+yy5:
+#line 65 "ext/pdo/pdo_sql_parser.re"
+	{ RET(PDO_PARSER_TEXT); }
+#line 102 "ext/pdo/pdo_sql_parser.c"
+yy6:
 	yych = *(YYMARKER = ++YYCURSOR);
-	if (yych >= 0x01) goto yy37;
-yy4:
+	if (yych >= 0x01) goto yy16;
+yy7:
 #line 63 "ext/pdo/pdo_sql_parser.re"
 	{ SKIP_ONE(PDO_PARSER_TEXT); }
-#line 86 "ext/pdo/pdo_sql_parser.c"
-yy5:
+#line 109 "ext/pdo/pdo_sql_parser.c"
+yy8:
 	yych = *(YYMARKER = ++YYCURSOR);
-	if (yych <= 0x00) goto yy4;
-	goto yy32;
-yy6:
+	if (yych <= 0x00) goto yy7;
+	goto yy21;
+yy9:
+	yych = *++YYCURSOR;
+	goto yy7;
+yy10:
+	yych = *++YYCURSOR;
+	switch (yych) {
+	case '-':	goto yy25;
+	default:	goto yy7;
+	}
+yy11:
+	yych = *(YYMARKER = ++YYCURSOR);
+	switch (yych) {
+	case '*':	goto yy28;
+	default:	goto yy7;
+	}
+yy12:
 	yych = *++YYCURSOR;
 	switch (yych) {
 	case '0':
@@ -152,104 +190,86 @@ yy6:
 	case 'w':
 	case 'x':
 	case 'y':
-	case 'z':	goto yy26;
-	case ':':	goto yy29;
-	default:	goto yy4;
+	case 'z':	goto yy30;
+	case ':':	goto yy33;
+	default:	goto yy7;
 	}
-yy7:
+yy13:
 	++YYCURSOR;
 	switch ((yych = *YYCURSOR)) {
-	case '?':	goto yy23;
-	default:	goto yy8;
+	case '?':	goto yy36;
+	default:	goto yy14;
 	}
-yy8:
+yy14:
 #line 62 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_BIND_POS); }
-#line 169 "ext/pdo/pdo_sql_parser.c"
-yy9:
-	yych = *++YYCURSOR;
-	goto yy4;
-yy10:
-	yych = *++YYCURSOR;
-	switch (yych) {
-	case '-':	goto yy21;
-	default:	goto yy4;
-	}
-yy11:
-	yych = *(YYMARKER = ++YYCURSOR);
-	switch (yych) {
-	case '*':	goto yy15;
-	default:	goto yy4;
-	}
-yy12:
+#line 207 "ext/pdo/pdo_sql_parser.c"
+yy15:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
+yy16:
 	switch (yych) {
-	case 0x00:
-	case '"':
-	case '\'':
-	case '(':
-	case ')':
-	case '*':
-	case '+':
-	case ',':
-	case '-':
-	case '.':
-	case '/':
-	case ':':
-	case '?':	goto yy14;
-	default:	goto yy12;
+	case 0x00:	goto yy2;
+	case '"':	goto yy17;
+	case '\\':	goto yy19;
+	default:	goto yy15;
 	}
-yy14:
-#line 65 "ext/pdo/pdo_sql_parser.re"
+yy17:
+	++YYCURSOR;
+#line 58 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_TEXT); }
-#line 208 "ext/pdo/pdo_sql_parser.c"
-yy15:
+#line 223 "ext/pdo/pdo_sql_parser.c"
+yy19:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	switch (yych) {
-	case '*':	goto yy17;
-	default:	goto yy15;
-	}
-yy17:
+	if (yych <= 0x00) goto yy2;
+	goto yy15;
+yy20:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
+yy21:
 	switch (yych) {
-	case '*':	goto yy17;
-	case '/':	goto yy19;
-	default:	goto yy15;
+	case 0x00:	goto yy2;
+	case '\'':	goto yy22;
+	case '\\':	goto yy24;
+	default:	goto yy20;
 	}
-yy19:
+yy22:
 	++YYCURSOR;
-yy20:
-#line 64 "ext/pdo/pdo_sql_parser.re"
+#line 59 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_TEXT); }
-#line 231 "ext/pdo/pdo_sql_parser.c"
-yy21:
+#line 245 "ext/pdo/pdo_sql_parser.c"
+yy24:
+	++YYCURSOR;
+	if (YYLIMIT <= YYCURSOR) YYFILL(1);
+	yych = *YYCURSOR;
+	if (yych <= 0x00) goto yy2;
+	goto yy20;
+yy25:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
 	switch (yych) {
 	case '\n':
-	case '\r':	goto yy20;
-	default:	goto yy21;
+	case '\r':	goto yy27;
+	default:	goto yy25;
 	}
-yy23:
+yy27:
+#line 64 "ext/pdo/pdo_sql_parser.re"
+	{ RET(PDO_PARSER_TEXT); }
+#line 264 "ext/pdo/pdo_sql_parser.c"
+yy28:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
 	switch (yych) {
-	case '?':	goto yy23;
-	default:	goto yy25;
+	case '*':	goto yy38;
+	default:	goto yy28;
 	}
-yy25:
-#line 60 "ext/pdo/pdo_sql_parser.re"
-	{ RET(PDO_PARSER_TEXT); }
-#line 252 "ext/pdo/pdo_sql_parser.c"
-yy26:
+yy30:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
@@ -316,65 +336,46 @@ yy26:
 	case 'w':
 	case 'x':
 	case 'y':
-	case 'z':	goto yy26;
-	default:	goto yy28;
+	case 'z':	goto yy30;
+	default:	goto yy32;
 	}
-yy28:
+yy32:
 #line 61 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_BIND); }
-#line 326 "ext/pdo/pdo_sql_parser.c"
-yy29:
-	++YYCURSOR;
-	if (YYLIMIT <= YYCURSOR) YYFILL(1);
-	yych = *YYCURSOR;
-	switch (yych) {
-	case ':':	goto yy29;
-	default:	goto yy25;
-	}
-yy31:
+#line 346 "ext/pdo/pdo_sql_parser.c"
+yy33:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-yy32:
 	switch (yych) {
-	case 0x00:	goto yy2;
-	case '\'':	goto yy34;
-	case '\\':	goto yy33;
-	default:	goto yy31;
+	case ':':	goto yy33;
+	default:	goto yy35;
 	}
-yy33:
-	++YYCURSOR;
-	if (YYLIMIT <= YYCURSOR) YYFILL(1);
-	yych = *YYCURSOR;
-	if (yych <= 0x00) goto yy2;
-	goto yy31;
-yy34:
-	++YYCURSOR;
-#line 59 "ext/pdo/pdo_sql_parser.re"
+yy35:
+#line 60 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_TEXT); }
-#line 356 "ext/pdo/pdo_sql_parser.c"
+#line 358 "ext/pdo/pdo_sql_parser.c"
 yy36:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-yy37:
 	switch (yych) {
-	case 0x00:	goto yy2;
-	case '"':	goto yy39;
-	case '\\':	goto yy38;
-	default:	goto yy36;
+	case '?':	goto yy36;
+	default:	goto yy35;
 	}
 yy38:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	if (yych <= 0x00) goto yy2;
-	goto yy36;
-yy39:
+	switch (yych) {
+	case '*':	goto yy38;
+	case '/':	goto yy40;
+	default:	goto yy28;
+	}
+yy40:
 	++YYCURSOR;
-#line 58 "ext/pdo/pdo_sql_parser.re"
-	{ RET(PDO_PARSER_TEXT); }
-#line 378 "ext/pdo/pdo_sql_parser.c"
+	yych = *YYCURSOR;
+	goto yy27;
 }
 #line 66 "ext/pdo/pdo_sql_parser.re"
 
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 14:03:34 2022 UTC