summaryrefslogtreecommitdiff
path: root/sys/src/cmd/python/Python/strdup.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org'>2020-02-27 15:09:10 -0500
committerOri Bernstein <ori@eigenstate.org'>2020-02-27 15:09:10 -0500
commit3df95385bcc5294a212534d0991f1ffef1454aca (patch)
tree8dde027184ce7f6a384931b0d922ccf8b5a963a2 /sys/src/cmd/python/Python/strdup.c
parent0f9666ae162f7c330850fa513e8ed3bd5fd995df (diff)
fix special case for null pointer constants in cond expressions
Section 6.5.15 of the C99 spec requires that if one argument of a ?: expression is a null pointer constant, and the other has a pointer type T*, then the type of the expression is T*. We were attempting to follow this rule, however, we only handled literal expressions when checking for null pointers. This change looks through casts, so 'nil' and 'NULL', and their expansion '(void*)0' are all detected as null pointer constants.
Diffstat (limited to 'sys/src/cmd/python/Python/strdup.c')
0 files changed, 0 insertions, 0 deletions