Skip to content

Commit

Permalink
v.pref: fix panic in parse_args_and_show_errors, called with no args (f…
Browse files Browse the repository at this point in the history
…ix #23713) (#23794)
  • Loading branch information
Bruno-Vdr authored Feb 23, 2025
1 parent 3c88926 commit e5e9b5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/v/pref/pref.v
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub mut:
is_liveshared bool // a shared library, that will be used in a -live main program
is_shared bool // an ordinary shared library, -shared, no matter if it is live or not
is_o bool // building an .o file
is_prof bool // benchmark every function
is_prof bool // benchmark every function
is_prod bool // use "-O3"
no_prod_options bool // `-no-prod-options`, means do not pass any optimization flags to the C compilation, while still allowing the user to use for example `-cflags -Os` to pass custom ones
is_repl bool
Expand Down Expand Up @@ -1079,7 +1079,7 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
run_code_in_tmp_vfile_and_exit(args, mut res, '-e', 'vsh', res.eval_argument)
}

command_args := args[command_idx + 1..]
command_args := args#[command_idx + 1..]
if res.is_run || res.is_crun {
res.path = command_args[0] or { eprintln_exit('v run: no v files listed') }
res.run_args = command_args[1..]
Expand Down

0 comments on commit e5e9b5d

Please sign in to comment.