From 33ddf2f56fe4aef097ff204fd7b64f7b0c519a99 Mon Sep 17 00:00:00 2001
From: Alexander Markov <alexmarkov@google.com>
Date: Fri, 11 Jul 2025 09:41:22 -0700
Subject: [PATCH] [vm] Fix gcc build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix the following error:
```
../../runtime/bin/main_options.cc:642:8: error: variable ‘run_script’ set but not used [-Werror=unused-but-set-variable]
  642 |   bool run_script = false;
      |        ^~~~~~~~~~
```

TEST=ci

Change-Id: I4b554ed604a14e5d8b9043971d9837c82ec840ce
Cq-Include-Trybots: luci.dart.try:vm-gcc-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439980
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
---
 runtime/bin/main_options.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/runtime/bin/main_options.cc b/runtime/bin/main_options.cc
index b94961c72391..6d363a77f3ef 100644
--- a/runtime/bin/main_options.cc
+++ b/runtime/bin/main_options.cc
@@ -639,7 +639,9 @@ bool Options::ParseArguments(int argc,
   // The arguments to the VM are at positions 1 through i-1 in argv.
   Platform::SetExecutableArguments(i, argv);
 
+#if !defined(DART_PRECOMPILED_RUNTIME)
   bool run_script = false;
+#endif
   // Get the script name.
   if (i < argc) {
 #if !defined(DART_PRECOMPILED_RUNTIME)
@@ -654,7 +656,9 @@ bool Options::ParseArguments(int argc,
     if (Options::disable_dart_dev() ||
         (Options::snapshot_filename() != nullptr) || is_potential_file_path) {
       *script_name = Utils::StrDup(argv[i]);
+#if !defined(DART_PRECOMPILED_RUNTIME)
       run_script = true;
+#endif
       i++;
     }
 #if !defined(DART_PRECOMPILED_RUNTIME)
