summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/lower-to-ir.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp
index 57fa55741..5f8428698 100644
--- a/source/slang/lower-to-ir.cpp
+++ b/source/slang/lower-to-ir.cpp
@@ -681,6 +681,15 @@ LoweredValInfo emitCallToDeclRef(
case kIRPseudoOp_Pos:
return LoweredValInfo::simple(args[0]);
+ case kIRPseudoOp_Sequence:
+ // The main effect of "operator comma" is to enforce
+ // sequencing of its operands, but Slang already
+ // implements a strictly left-to-right evaluation
+ // order for function arguments, so in practice we
+ // just need to compile `a, b` to the value of `b`
+ // (because argument evaluation already happened).
+ return LoweredValInfo::simple(args[1]);
+
#define CASE(COMPOUND, OP) \
case COMPOUND: return emitCompoundAssignOp(context, type, OP, argCount, args)