From 6fadb0a572ceaf2c9c5ed36166155f9df4db9da5 Mon Sep 17 00:00:00 2001 From: LPeter1997 Date: Thu, 12 Oct 2023 14:21:01 +0200 Subject: [PATCH] Update TreeInstruction.cs --- .../Internal/OptimizingIr/Model/TreeInstruction.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Draco.Compiler/Internal/OptimizingIr/Model/TreeInstruction.cs b/src/Draco.Compiler/Internal/OptimizingIr/Model/TreeInstruction.cs index c5e9e5278..2bec0cc26 100644 --- a/src/Draco.Compiler/Internal/OptimizingIr/Model/TreeInstruction.cs +++ b/src/Draco.Compiler/Internal/OptimizingIr/Model/TreeInstruction.cs @@ -31,6 +31,8 @@ internal sealed class TreeInstruction : InstructionBase, IOperand, IValueInstruc public TreeInstruction(IValueInstruction underlying, ImmutableArray operands) { + if (underlying is TreeInstruction) throw new ArgumentOutOfRangeException(nameof(underlying)); + this.Underlying = underlying; this.Operands = operands; }