aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-11-08 14:42:45 -0500
committerJacob Young <jacobly0@users.noreply.github.com>2023-11-08 14:43:23 -0500
commit52d8099daeb34edc00898ef8cc34bd6f136949aa (patch)
tree5ba0c3e59317e8dd97b90bc6b151022764b037ff /src
parent045a5e924ce9abe239634545b0ad35576cc2fafc (diff)
downloadzig-52d8099daeb34edc00898ef8cc34bd6f136949aa.tar.gz
zig-52d8099daeb34edc00898ef8cc34bd6f136949aa.zip
Sema: don't allow passing non-extern types to varargs parameters
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 241f65a9a0..0911f75feb 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -29436,6 +29436,7 @@ fn coerceVarArgParam(
}
},
else => if (uncasted_ty.isAbiInt(mod)) int: {
+ if (!try sema.validateExternType(uncasted_ty, .param_ty)) break :int inst;
const target = sema.mod.getTarget();
const uncasted_info = uncasted_ty.intInfo(mod);
if (uncasted_info.bits <= target.c_type_bit_size(switch (uncasted_info.signedness) {