Skip to content

Commit

Permalink
Use MIN/MAX when dumping RANGE[]
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikic committed Nov 20, 2020
1 parent c0d1dbc commit fa67864
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/opcache/Optimizer/zend_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit fa67864

Please sign in to comment.