Skip to content

Commit c324bda

Browse files
committed
embed.fnc: Add EPTRQ constraints
Generally, a pointer to a string upper bound actually is to one beyond the actual final byte in the string. This is sanctioned by the C Standard, and allows you to just subtract the lower bound from it to get its length, without having to add 1. But some functions are written to tolerate the upper bound pointer being set to the actual final byte. The EPTRQ constraint in embed.fnc is used for those; the assertion becomes 'l <= u' instead of strictly less-than. This commit is the first to use this type of constraint, and it applies it only to those functions whose documentation or behavior clearly indicate this is expected. I removed now redundant asserts that were in the functions, and now are included in the ARGS_ASSERT macros There's a dozen-ish ones where that isn't true. And they need to be investigated further before deciding their disposition.
1 parent a967a9c commit c324bda

File tree

6 files changed

+130
-138
lines changed

6 files changed

+130
-138
lines changed

0 commit comments

Comments
 (0)