[LLVMbugs] [Bug 17641] New: Clang tutorial # 2 crash
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Oct 21 13:40:02 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=17641
Bug ID: 17641
Summary: Clang tutorial # 2 crash
Product: new-bugs
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: nicmail777 at yahoo.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
I've downloaded and compiled tutorial from here:
https://github.com/loarabia/Clang-tutorial/blob/master/tutorial2.cpp
For input, I've a simple "hello world", with one #include
(The #include is part of the problem)
The program crashes here:
file: Lex\HeaderSearch.h
code:
-----------------------------------------------------
HeaderSearchOptions &getHeaderSearchOpts() const {
return *HSOpts; <-- crash
}
-----------------------------------------------------
because HSOpts is null.
My bypass was to change the tutorial example,
from:
llvm::IntrusiveRefCntPtr<clang::HeaderSearchOptions> hso;
to:
llvm::IntrusiveRefCntPtr<clang::HeaderSearchOptions> hso(new
clang::HeaderSearchOptions);
(ignore the memory leak)
But the issue is the crash is not nice welcome when you try a tutorial (:
Anyways, Clang is very good and thanks for everyone who work on this project !
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131021/3ae2ba57/attachment.html>
More information about the llvm-bugs
mailing list