Opened 10 years ago
Closed 10 years ago
#3090 closed patch (fixed)
A confusing line in Raster/rt_pg/rt_pg.c
Reported by: | kain | Owned by: | Bborie Park |
---|---|---|---|
Priority: | low | Milestone: | PostGIS 2.1.7 |
Component: | raster | Version: | 2.1.x |
Keywords: | Cc: |
Description
In function RASTER_setPixelValuesArray() of aster/rt_pg/rt_pg.c:
3538 - else if (!PG_ARGISNULL(6) & PG_GETARG_BOOL(6)) { 3538 + else if (!PG_ARGISNULL(6) && PG_GETARG_BOOL(6)) {
I'm confused, because BOOL & BOOL == BOOL && BOOL seems correct, but it's only logical, we will never know what happens in C language, right?
Change History (4)
follow-up: 2 comment:1 by , 10 years ago
comment:2 by , 10 years ago
Replying to kain:
And & will force PG_GETARG_BOOL(6) be invoked no matter @6 is NULL or not, it is incorrect from logical side.
Another example, if ( NOTNULL(p) && SUCCESS_FREE(p) )
, if we use & instead of &&, the app will crash, so & and && are not equal even both left/right are BOOL.
comment:3 by , 10 years ago
Status: | new → assigned |
---|
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
And & will force PG_GETARG_BOOL(6) be invoked no matter @6 is NULL or not, it is incorrect from logical side.