Skip to content

Commit 0edb1fe

Browse files
committed
Fix compilation
1 parent cd39173 commit 0edb1fe

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/AdapterArmaDiag.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include "ProfilerAdapter.hpp"
33
#include <functional>
4+
#include <chrono>
45

56

67

src/NetworkProfiler.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <intercept.hpp>
3+
#include <chrono>
34
using namespace intercept;
45
using namespace std::chrono_literals;
56

src/scriptProfiler.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,11 +807,11 @@ game_value compileRedirectFinal(game_state& state, game_value_parameter message)
807807

808808
bodyString = message;
809809

810-
auto comp = resultValue = sqf::compile_final(bodyString);
811-
bodyCode = static_cast<game_data_code*>(comp.data.get());
810+
resultValue = sqf::compile_final(bodyString);
811+
bodyCode = static_cast<game_data_code*>(resultValue.data.get());
812812
if (bodyCode->instructions.empty()) {
813813
GProfilerAdapter->leaveScope(tempData);
814-
return comp;
814+
return resultValue;
815815
}
816816

817817
#ifdef WITH_BROFILER
@@ -829,6 +829,10 @@ game_value compileRedirectFinal(game_state& state, game_value_parameter message)
829829

830830
bodyCode = static_cast<game_data_code*>(resultValue.data.get());
831831
bodyString = bodyCode->code_string;
832+
if (bodyCode->instructions.empty()) {
833+
GProfilerAdapter->leaveScope(tempData); //#TODO do we even need to leave this, or is it RAII?
834+
return resultValue;
835+
}
832836
} else {
833837
//#TODO call the function directly once this was fixed with 2.14 release
834838
return host::functions.invoke_raw_unary(compileFinal214, message);

0 commit comments

Comments
 (0)