mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-02-03 01:00:31 +03:00
Compiler: Fix improper handling of constant chained relational operators.
Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=3838.
This commit is contained in:
parent
4f525b9150
commit
3b2618f63b
@ -488,6 +488,7 @@ static int plnge_rel(int *opstr,int opoff,int (*hier)(value *lval),value *lval)
|
|||||||
int lvalue,opidx;
|
int lvalue,opidx;
|
||||||
value lval2 = {0}; /* intialize, to avoid a compiler warning */
|
value lval2 = {0}; /* intialize, to avoid a compiler warning */
|
||||||
int count;
|
int count;
|
||||||
|
char boolresult;
|
||||||
|
|
||||||
/* this function should only be called for relational operators */
|
/* this function should only be called for relational operators */
|
||||||
assert(op1[opoff]==os_le);
|
assert(op1[opoff]==os_le);
|
||||||
@ -504,7 +505,9 @@ static int plnge_rel(int *opstr,int opoff,int (*hier)(value *lval),value *lval)
|
|||||||
error(212);
|
error(212);
|
||||||
if (count>0) {
|
if (count>0) {
|
||||||
relop_prefix();
|
relop_prefix();
|
||||||
|
boolresult = lval->boolresult;
|
||||||
*lval=lval2; /* copy right hand expression of the previous iteration */
|
*lval=lval2; /* copy right hand expression of the previous iteration */
|
||||||
|
lval->boolresult = boolresult;
|
||||||
} /* if */
|
} /* if */
|
||||||
opidx+=opoff;
|
opidx+=opoff;
|
||||||
plnge2(op1[opidx],hier,lval,&lval2);
|
plnge2(op1[opidx],hier,lval,&lval2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user