summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-12-31 22:19:45 -0700
committerKarl Williamson <public@khwilliamson.com>2014-01-01 13:49:24 -0700
commit902008b8891cbab762cbca65291391e811857949 (patch)
tree949ca4678d0a040353d512274887b35310bacf9f /handy.h
parent0f092d081073e047f09aa9ef4f1d62bf5db65747 (diff)
downloadperl-902008b8891cbab762cbca65291391e811857949.tar.gz
handy.h: Add debugging assertion
This macro requires the input to be a hex digit, without testing. It is prudent to assert that under DEBUGGING.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/handy.h b/handy.h
index fb84cb9aff..c4a162d8d2 100644
--- a/handy.h
+++ b/handy.h
@@ -1568,7 +1568,9 @@ typedef U32 line_t;
* pointer. The input must be known to be 0-9, A-F, or a-f. In both ASCII and
* EBCDIC the last 4 bits of the digits are 0-9; and the last 4 bits of A-F and
* a-f are 1-6, so adding 9 yields 10-15 */
-#define READ_XDIGIT(s) (0xf & (isDIGIT(*(s)) ? (*(s)++) : (*(s)++ + 9)))
+#define READ_XDIGIT(s) (__ASSERT_(isXDIGIT(*s)) (0xf & (isDIGIT(*(s)) \
+ ? (*(s)++) \
+ : (*(s)++ + 9))))
/*
=head1 Memory Management