[MCJIT] Teach RuntimeDyldChecker to handle underscores at the start of symbols.
authorLang Hames <lhames@gmail.com>
Tue, 22 Jul 2014 23:17:21 +0000 (23:17 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 22 Jul 2014 23:17:21 +0000 (23:17 +0000)
RuntimeDyldChecker had been testing isalpha(Expr[0]) to recognise symbol tokens,
and throwing unrecognized token errors when it hit symbols with leading
underscores. This fixes that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213706 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp

index 72075f5..308d80e 100644 (file)
@@ -519,7 +519,7 @@ private:
       std::tie(SubExprResult, RemainingExpr) = evalParensExpr(Expr, PCtx);
     else if (Expr[0] == '*')
       std::tie(SubExprResult, RemainingExpr) = evalLoadExpr(Expr);
-    else if (isalpha(Expr[0]))
+    else if (isalpha(Expr[0]) || Expr[0] == '_')
       std::tie(SubExprResult, RemainingExpr) = evalIdentifierExpr(Expr, PCtx);
     else if (isdigit(Expr[0]))
       std::tie(SubExprResult, RemainingExpr) = evalNumberExpr(Expr);