Skip to content

Commit 312447e

Browse files
committed
Derive the MINFO format version from RDUMP_FORMAT_VERSION
MINFO hardcoded "3" while the dump header uses the RDUMP_FORMAT_VERSION macro; stringize the macro (RDUMP_FORMAT_VERSION_STR) so bumping the version updates both in one place. https://claude.ai/code/session_017skw8BsHkF8wur7Pf4G9W5
1 parent 7d99002 commit 312447e

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

php_rdump.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ extern zend_module_entry rdump_module_entry;
2020

2121
/* RDUMP dump-file format version we emit (must match reli's reader range). */
2222
#define RDUMP_FORMAT_VERSION 3
23+
/* Stringized form for display (keeps MINFO in step with the numeric value). */
24+
#define RDUMP_STRINGIZE_(x) #x
25+
#define RDUMP_STRINGIZE(x) RDUMP_STRINGIZE_(x)
26+
#define RDUMP_FORMAT_VERSION_STR RDUMP_STRINGIZE(RDUMP_FORMAT_VERSION)
2327

2428
/* Per-(thread-)module state, holding the INI-configured auto-dump settings
2529
* and a re-entrancy guard for the zend_error_cb OOM hook. */

rdump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ PHP_MINFO_FUNCTION(rdump)
11081108
php_info_print_table_start();
11091109
php_info_print_table_row(2, "rdump support", "enabled");
11101110
php_info_print_table_row(2, "extension version", PHP_RDUMP_VERSION);
1111-
php_info_print_table_row(2, "RDUMP format version", "3");
1111+
php_info_print_table_row(2, "RDUMP format version", RDUMP_FORMAT_VERSION_STR);
11121112
php_info_print_table_row(2, "target php version tag", php_version);
11131113
php_info_print_table_row(2, "memory_limit auto-dump", "available (zend_error_cb)");
11141114
php_info_print_table_end();

0 commit comments

Comments
 (0)