Skip to content

Commit bf9f1e7

Browse files
nsajkoKristofferC
authored andcommitted
Base: macro cmd: restrict argument to String (#57862)
Should make the sysimage less vulnerable to invalidation. As far as I understand this change can't break any code, because: * the macro definition requires `AbstractString` * the way Julia macros work, the argument is either a literal or an `Expr` * `String` is the only `AbstractString` with literals (cherry picked from commit 7acb2a6)
1 parent 4f6c665 commit bf9f1e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/cmd.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ julia> run(cm)
504504
Process(`echo 1`, ProcessExited(0))
505505
```
506506
"""
507-
macro cmd(str)
507+
macro cmd(str::String)
508508
cmd_ex = shell_parse(str, special=shell_special, filename=String(__source__.file))[1]
509509
return :(cmd_gen($(esc(cmd_ex))))
510510
end

0 commit comments

Comments
 (0)