From 3b3efd7053560a84d94ead0b31795bed9b43e52b Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Fri, 1 Sep 2023 12:43:43 -0700 Subject: [PATCH] [glsl-in] Doc fix. --- src/front/glsl/parser/functions.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/front/glsl/parser/functions.rs b/src/front/glsl/parser/functions.rs index 358bc52e76..200afc78fd 100644 --- a/src/front/glsl/parser/functions.rs +++ b/src/front/glsl/parser/functions.rs @@ -195,6 +195,11 @@ impl<'source> ParsingContext<'source> { match ctx.module.const_expressions[const_expr] { Expression::Literal(Literal::I32(value)) => match uint { + // This unchecked cast isn't good, but since + // we only reach this code when the selector + // is unsigned but the case label is signed, + // verification will reject the module + // anyway (which also matches GLSL's rules). true => crate::SwitchValue::U32(value as u32), false => crate::SwitchValue::I32(value), },