Empty loops need to check surprise flags
We didnt count a brach to itself as a backward branch. Also, there seemed to be a signed vs unsigned issue with IterBreak.
Esse commit está contido em:
@@ -3948,7 +3948,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopFatal(PC& pc) {
|
||||
}
|
||||
|
||||
inline void OPTBLD_INLINE VMExecutionContext::jmpSurpriseCheck(Offset offset) {
|
||||
if (offset < 0 && UNLIKELY(Transl::TargetCache::loadConditionFlags())) {
|
||||
if (offset <= 0 && UNLIKELY(Transl::TargetCache::loadConditionFlags())) {
|
||||
EventHook::CheckSurprise();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1107,7 +1107,7 @@ void HhbcTranslator::emitIterBreak(const ImmVector& iv,
|
||||
uint32_t offset,
|
||||
bool breakTracelet,
|
||||
bool noSurprise) {
|
||||
bool backward = (offset - (int32_t)bcOff()) < 0;
|
||||
bool backward = offset <= bcOff();
|
||||
if (backward && !noSurprise) {
|
||||
gen(ExitWhenSurprised, getExitSlowTrace());
|
||||
}
|
||||
@@ -1615,7 +1615,7 @@ void HhbcTranslator::emitJmp(int32_t offset,
|
||||
bool breakTracelet,
|
||||
bool noSurprise) {
|
||||
// If surprise flags are set, exit trace and handle surprise
|
||||
bool backward = (offset - (int32_t)bcOff()) < 0;
|
||||
bool backward = (uint32_t)offset <= bcOff();
|
||||
if (backward && !noSurprise) {
|
||||
gen(ExitWhenSurprised, getExitSlowTrace());
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário