]> granicus.if.org Git - php/commitdiff
Use MIN/MAX when dumping RANGE[]
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 19 Nov 2020 11:46:52 +0000 (12:46 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 20 Nov 2020 15:47:46 +0000 (16:47 +0100)
It's very common that one of the bounds is LONG_MIN or LONG_MAX.
Dump them as MIN/MAX instead of the int representation in that
case, as it makes the dump less noisy.

ext/opcache/Optimizer/zend_dump.c

index f6d9bd519a5051c0e5d2beeda1dacbeacbc0c4cb..73ddd77a988df005c20ae89b86937d46f5f5a3ac 100644 (file)
@@ -154,11 +154,15 @@ static void zend_dump_range(const zend_ssa_range *r)
        fprintf(stderr, " RANGE[");
        if (r->underflow) {
                fprintf(stderr, "--..");
+       } else if (r->min == ZEND_LONG_MIN) {
+               fprintf(stderr, "MIN..");
        } else {
                fprintf(stderr, ZEND_LONG_FMT "..", r->min);
        }
        if (r->overflow) {
                fprintf(stderr, "++]");
+       } else if (r->max == ZEND_LONG_MAX) {
+               fprintf(stderr, "MAX]");
        } else {
                fprintf(stderr, ZEND_LONG_FMT "]", r->max);
        }