summaryrefslogtreecommitdiffstats
path: root/source/slang/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/parser.cpp')
-rw-r--r--source/slang/parser.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp
index c3969be42..e232880e9 100644
--- a/source/slang/parser.cpp
+++ b/source/slang/parser.cpp
@@ -572,7 +572,17 @@ namespace Slang
// Splice the modifier into the linked list
- modifier->next = *modifierLink;
+ // We need to deal with the case where the modifeir to
+ // be spliced in might actually be a modifier *list*,
+ // so that we actually want to splice in at the
+ // end of the new list...
+ auto spliceLink = &modifier->next;
+ while(*spliceLink)
+ spliceLink = &(*spliceLink)->next;
+
+ // Do the splice.
+ *spliceLink = *modifierLink;
+
*modifierLink = modifier;
modifierLink = &modifier->next;
}