Skip to content
This repository has been archived by the owner on Aug 15, 2017. It is now read-only.

UnaryExpr returns null when calling clang::getCursorExpr, clang::getC… #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sealang/sealang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}

Expand All @@ -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<clang::UnaryOperatorKind>(op->getOpcode());
}

Expand Down