From f4c1b0a9f3203912b6367d8de4ab7508517e60ef Mon Sep 17 00:00:00 2001 From: ct Date: Sun, 23 Jul 2017 06:40:48 -0400 Subject: [PATCH] UnaryExpr returns null when calling clang::getCursorExpr, clang::getCursorStmt fixes issue --- sealang/sealang.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sealang/sealang.cpp b/sealang/sealang.cpp index 6ef8546..89cfb33 100644 --- a/sealang/sealang.cpp +++ b/sealang/sealang.cpp @@ -81,7 +81,7 @@ CXString clang_Cursor_getOperatorString(CXCursor cursor) } if (cursor.kind == CXCursor_UnaryOperator) { - clang::UnaryOperator *op = (clang::UnaryOperator*) clang::getCursorExpr(cursor); + clang::UnaryOperator *op = (clang::UnaryOperator*) clang::getCursorStmt(cursor); return clang::cxstring::createDup(clang::UnaryOperator::getOpcodeStr(op->getOpcode())); } @@ -106,7 +106,7 @@ clang::BinaryOperatorKind clang_Cursor_getBinaryOpcode(CXCursor cursor) clang::UnaryOperatorKind clang_Cursor_getUnaryOpcode(CXCursor cursor) { if (cursor.kind == CXCursor_UnaryOperator) { - clang::UnaryOperator *op = (clang::UnaryOperator*) clang::getCursorExpr(cursor); + clang::UnaryOperator *op = (clang::UnaryOperator*) clang::getCursorStmt(cursor); return static_cast(op->getOpcode()); }