From facd44c2ec235bb562ee1ca09ba4f305f8822b86 Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Sat, 22 Mar 2025 13:07:39 +0100 Subject: [PATCH] `Base`: `macro b_str`: restrict argument to `String` 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 --- base/strings/io.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/strings/io.jl b/base/strings/io.jl index d072786923304..f321376dbee50 100644 --- a/base/strings/io.jl +++ b/base/strings/io.jl @@ -585,7 +585,7 @@ julia> v[2] 0x32 ``` """ -macro b_str(s) +macro b_str(s::String) v = codeunits(unescape_string(s)) QuoteNode(v) end