Skip to content

Commit 5e3d4ef

Browse files
committed
engine: Set stack options in own scope
1 parent fa7d258 commit 5e3d4ef

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

engine/src/main.cpp

+15-12
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,22 @@ int main(int argc, char** argv) {
149149
}
150150

151151
// Setup stack, applying strict/secure mode if necessary, and provide launch command.
152-
if (stack_options.secure_mode) {
153-
stack_options.strict_mode = true;
154-
stack_options.no_hooks = true;
155-
stack_options.interpolate_vars = false;
156-
}
157-
if (stack_options.strict_mode) {
158-
stack_options.no_system_plugins = true;
159-
stack_options.no_system_confs = true;
160-
run_options.require_success = true;
152+
{
153+
if (stack_options.secure_mode) {
154+
stack_options.strict_mode = true;
155+
stack_options.no_hooks = true;
156+
stack_options.interpolate_vars = false;
157+
}
158+
if (stack_options.strict_mode) {
159+
stack_options.no_system_plugins = true;
160+
stack_options.no_system_confs = true;
161+
run_options.require_success = true;
162+
}
163+
stack_options.environment->prefer_external(false);
164+
stack_options.environment->allow_undefined(stack_options.interpolate_undefined);
165+
stack_options.environment->insert(CLOE_SIMULATION_UUID_VAR, "${" CLOE_SIMULATION_UUID_VAR "}");
161166
}
162-
stack_options.environment->prefer_external(false);
163-
stack_options.environment->allow_undefined(stack_options.interpolate_undefined);
164-
stack_options.environment->insert(CLOE_SIMULATION_UUID_VAR, "${" CLOE_SIMULATION_UUID_VAR "}");
167+
165168
auto with_stack_options = [&](auto& opt) -> decltype(opt) {
166169
opt.stack_options = stack_options;
167170
return opt;

0 commit comments

Comments
 (0)