+ OPC->_float = FLOAT_IS_TRUE_FOR_INT(OPA->_int) && FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add AND_I to be used by fteqcc for anything not a float
break;
case OP_OR:
- OPC->_float = OPA->_float || OPB->_float;
+ OPC->_float = FLOAT_IS_TRUE_FOR_INT(OPA->_int) || FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add OR_I to be used by fteqcc for anything not a float
+ // TODO add an "int-if", and change this one to OPA->_float
+ // although mostly unneeded, thanks to the only float being false being 0x0 and 0x80000000 (negative zero)
+ // and entity, string, field values can never have that value
{
prog->xfunction->profile += (st - startst);
st += st->b - 1; // offset the s++
startst = st;
- if (++jumpcount == 1000000000)
+ // no bounds check needed, it is done when loading progs
+ if (++jumpcount == 10000000 && prvm_runawaycheck)
{
prog->xstatement = st - prog->statements;
- PRVM_ERROR("runaway loop counter hit limit of %d jumps\ntip: if having trouble identifying the problem, try typing profile now in %s", jumpcount, PRVM_NAME);
+ PRVM_Profile(1<<30, 1000000, 0);
+ PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
}
}
break;
case OP_IF:
- if (OPA->_int)
+ if(FLOAT_IS_TRUE_FOR_INT(OPA->_int))
+ // TODO add an "int-if", and change this one, as well as the FLOAT_IS_TRUE_FOR_INT usages, to OPA->_float
+ // although mostly unneeded, thanks to the only float being false being 0x0 and 0x80000000 (negative zero)
+ // and entity, string, field values can never have that value
{
prog->xfunction->profile += (st - startst);
st += st->b - 1; // offset the s++
startst = st;
- if (++jumpcount == 1000000000)
+ // no bounds check needed, it is done when loading progs
+ if (++jumpcount == 10000000 && prvm_runawaycheck)
{
prog->xstatement = st - prog->statements;
- PRVM_ERROR("runaway loop counter hit limit of %d jumps\ntip: if having trouble identifying the problem, try typing profile now in %s", jumpcount, PRVM_NAME);
+ PRVM_Profile(1<<30, 1000000, 0);
+ PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
+ // no bounds check needed, it is done when loading progs
+ if (++jumpcount == 10000000 && prvm_runawaycheck)
{
prog->xstatement = st - prog->statements;
- PRVM_ERROR("runaway loop counter hit limit of %d jumps\ntip: if having trouble identifying the problem, try typing profile now in %s", jumpcount, PRVM_NAME);
+ PRVM_Profile(1<<30, 1000000, 0);
+ PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);