mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-25 07:00:50 +01:00
Seccomp/BPFEmitter: Reorder check to avoid integer overflow warning
This commit is contained in:
1 file changed
+4
-4
@@ -307,10 +307,6 @@ uint64_t BPFEmitter::HandleEmission(uint32_t flags, const sock_fprog* prog) {
|
||||
|
||||
HadError = PredFunc(Result);
|
||||
|
||||
if constexpr (CalculateSize) {
|
||||
CalculatedSize += Result;
|
||||
}
|
||||
|
||||
if (HadError) {
|
||||
if constexpr (!CalculateSize) {
|
||||
// Had error, early return and free the memory.
|
||||
@@ -318,6 +314,10 @@ uint64_t BPFEmitter::HandleEmission(uint32_t flags, const sock_fprog* prog) {
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
if constexpr (CalculateSize) {
|
||||
CalculatedSize += Result;
|
||||
}
|
||||
}
|
||||
|
||||
if constexpr (CalculateSize) {
|
||||
|
||||
Reference in new issue
Block a user