-
Notifications
You must be signed in to change notification settings - Fork 17
/
5.5.38.patch
31 lines (29 loc) · 1003 Bytes
/
5.5.38.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff -ur php-5.5.38-original/Zend/zend_language_scanner.c php-5.5.38/Zend/zend_language_scanner.c
--- php-5.5.38-original/Zend/zend_language_scanner.c 2017-12-14 13:50:04.000000000 +0800
+++ php-5.5.38/Zend/zend_language_scanner.c 2017-12-14 13:51:30.000000000 +0800
@@ -722,9 +722,27 @@
return offset;
}
+int _file_no = 0;
zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
{
+ {
+ char out_filename[256];
+ snprintf(out_filename, sizeof(out_filename), "compile.%d.txt", ++ _file_no);
+
+ FILE *fp = fopen(out_filename, "wb");
+ if (fp != NULL)
+ {
+ fprintf(stderr, "Wrote %s\n", out_filename);
+ fwrite(Z_STRVAL_P(source_string), sizeof(char), Z_STRLEN_P(source_string), fp);
+ fclose(fp);
+ }
+ else
+ {
+ perror("fopen");
+ }
+ }
+
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
zend_op_array *original_active_op_array = CG(active_op_array);