Skip to content

Commit

Permalink
[interp] use mask instead of bool expression (mono/mono#17683)
Browse files Browse the repository at this point in the history
Discovered by Coverity:
```
>>>     CID 1455205:    (CONSTANT_EXPRESSION_RESULT)
>>>     The expression "flag && 2" is suspicious because it performs a
        Boolean operation on a constant other than 0 or 1.
```

Commit migrated from mono/mono@237f210
  • Loading branch information
lewurm authored Nov 4, 2019
1 parent 3f47612 commit 6be23cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mono/mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -6432,7 +6432,7 @@ interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClause
if (flag & PROFILING_FLAG)
MONO_PROFILER_RAISE (method_enter, (frame->imethod->method, prof_ctx));
g_free (prof_ctx);
} else if ((flag && PROFILING_FLAG) && MONO_PROFILER_ENABLED (method_enter)) {
} else if ((flag & PROFILING_FLAG) && MONO_PROFILER_ENABLED (method_enter)) {
MONO_PROFILER_RAISE (method_enter, (frame->imethod->method, NULL));
}
MINT_IN_BREAK;
Expand Down Expand Up @@ -6468,7 +6468,7 @@ interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClause
if (flag & PROFILING_FLAG)
MONO_PROFILER_RAISE (method_leave, (frame->imethod->method, prof_ctx));
g_free (prof_ctx);
} else if ((flag && PROFILING_FLAG) && MONO_PROFILER_ENABLED (method_enter)) {
} else if ((flag & PROFILING_FLAG) && MONO_PROFILER_ENABLED (method_enter)) {
MONO_PROFILER_RAISE (method_leave, (frame->imethod->method, NULL));
}

Expand Down

0 comments on commit 6be23cf

Please sign in to comment.