From 228a5cbf1c2907369dec49999f51f243bf8d72df Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 22 Apr 2011 23:20:12 +0200 Subject: [PATCH] Set precedence for TOKgep as well, now that we have the assert back in expToCBuffer. --- dmd/expression.h | 1 + dmd/parse.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/dmd/expression.h b/dmd/expression.h index c38dfdef..e6e39ae9 100644 --- a/dmd/expression.h +++ b/dmd/expression.h @@ -1925,6 +1925,7 @@ struct LineInitExp : DefaultInitExp // this stuff is strictly LDC +// Special expression to represent a LLVM GetElementPtr instruction. struct GEPExp : UnaExp { unsigned index; diff --git a/dmd/parse.c b/dmd/parse.c index 17f1e8c4..80cfe258 100644 --- a/dmd/parse.c +++ b/dmd/parse.c @@ -5625,6 +5625,11 @@ void initPrecedence() precedence[TOKcomma] = PREC_expr; precedence[TOKdeclaration] = PREC_expr; + +#if IN_LLVM + // Need to set precedence for TOKgep as well, as expToCBuffer expects it. + precedence[TOKgep] = PREC_primary; +#endif }