Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 96d48f3

Browse files
author
Reini Urban
committed
fix PN_TYPECHECK
found by coverity: Macro compares unsigned to 0 (NO_EFFECT) unsigned_compare: This greater-than-or-equal-to-zero comparison of an unsigned value is always true. t - 2424832U >= 0U.
1 parent a8596e5 commit 96d48f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎core/potion.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ struct PNVtable;
134134
#define PN_VTYPE(x) (((struct PNObject *)(x))->vt)
135135
#define PN_TYPE_ID(t) ((t)-PN_TNIL)
136136
#define PN_VTABLE(t) (PN_FLEX_AT(P->vts, PN_TYPE_ID(t)))
137-
#define PN_TYPECHECK(t) (PN_TYPE_ID(t) >= 0 && PN_TYPE_ID(t) < PN_FLEX_SIZE(P->vts))
137+
#define PN_TYPECHECK(t) (t >= PN_TNIL && PN_TYPE_ID(t) < PN_FLEX_SIZE(P->vts))
138138

139139
#define PN_NIL ((PN)0)
140140
#define PN_ZERO ((PN)1) //i.e. PN_NUM(0)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /