diff options
author | truckman <truckman@FreeBSD.org> | 2014-07-02 17:32:43 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2014-07-02 17:32:43 +0000 |
commit | eca942517b0f7ca74b31bad5ebc3c7d26f34804a (patch) | |
tree | da1d32ed7a26c796b24cdb659ae6d5b5d78ebb17 /lib/libc/stdio/fputwc.c | |
parent | a33844e926a330bdb5c1966b112da53d2735b82a (diff) | |
download | FreeBSD-src-eca942517b0f7ca74b31bad5ebc3c7d26f34804a.zip FreeBSD-src-eca942517b0f7ca74b31bad5ebc3c7d26f34804a.tar.gz |
MFC r266814
Initialize r_flags the same way in all cases using a sanitized copy of
flags that has several bits cleared. The RF_WANTED and RF_FIRSTSHARE
bits are invalid in this context, and we want to defer setting RF_ACTIVE
in r_flags until later. This should make rman_get_flags() return
the correct answer in all cases.
Add a KASSERT() to catch callers which incorrectly pass the RF_WANTED
or RF_FIRSTSHARE flags.
Do a strict equality check on the share type bits of flags. In
particular, do an equality check on RF_PREFETCHABLE. The previous
code would allow one type of mismatch of RF_PREFETCHABLE but disallow
the other type of mismatch. Also, ignore the the RF_ALIGNMENT_MASK
bits since alignment validity should be handled by the amask check.
This field contains an integer value, but previous code did a strange
bitwise comparison on it.
Leave the original value of flags unmolested as a minor debug aid.
Change the start+amask overflow check to a KASSERT() since it is just
meant to catch a highly unlikely programming error in the caller.
Reviewed by: jhb
Diffstat (limited to 'lib/libc/stdio/fputwc.c')
0 files changed, 0 insertions, 0 deletions