[cfe-dev] heap problem in SemaLookup.cpp

Jay Foad jay.foad at gmail.com
Mon May 18 03:23:49 PDT 2009


If I build with ENABLE_EXPENSIVE_CHECKS=1 I get the following test
failure. I've attached the obvious patch to fix it.

It seems like this bug could have caused non-deterministic problems
with using-directives.

Thanks,
Jay.

******************** TEST
'/home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp'
FAILED! ****************
****
Command:
 /home/foad/llvm/objdir-svn/Debug+Checks/bin/clang-cc -fsyntax-only
-verify /home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp
Incorrect Output:
/usr/include/c++/4.3/bits/stl_heap.h:458:error: elements in iterator range [
    __first, __last) do not form a heap.

Objects involved in the operation:
iterator "__first" @ 0x0xbff688c0 {
type = PPN5clang18UsingDirectiveDeclE;
}
iterator "__last" @ 0x0xbff688c4 {
type = PPN5clang18UsingDirectiveDeclE;
}
0   clang-cc       0x091e2cdf
1   clang-cc       0x091e337e
2                  0x4001c400 __kernel_sigreturn + 0
3   libc.so.6      0x4019d018 abort + 392
4   libstdc++.so.6 0x4009f531
__gnu_debug::_Error_formatter::_M_error() const + 529
5   clang-cc       0x08360d2a
6   clang-cc       0x0835c3d3
7   clang-cc       0x0835cd9e
8   clang-cc       0x0835d4f9
9   clang-cc       0x08302462
10  clang-cc       0x084f1392
11  clang-cc       0x084f1453
12  clang-cc       0x084ed5a1
13  clang-cc       0x08511277
14  clang-cc       0x085158f7
15  clang-cc       0x08515f9c
16  clang-cc       0x084dc715
17  clang-cc       0x084dd223
18  clang-cc       0x084dd899
19  clang-cc       0x084dd94b
20  clang-cc       0x082cabdd
21  clang-cc       0x08115038
22  clang-cc       0x081166ec main + 2626
23  libc.so.6      0x40186455 __libc_start_main + 229
24  clang-cc       0x08096561
Stack dump:
0.      Program arguments:
/home/foad/llvm/objdir-svn/Debug+Checks/bin/clang-cc -fsyntax-only
-verify /home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp
1.      /home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp:40:1:
current parser token '}'
2.      /home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp:35:22:
parsing function body 'test_nslookup'
3.      /home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp:35:22:
in compound statement ('{}')
Output//home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp.out.script:
line 1:  2678 Aborted
/home/foad/llvm/objdir-svn/Debug+Checks/bin/clang-cc -fsyntax-only
-verify /home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp
******************** TEST
'/home/foad/svn/llvm-project/cfe/trunk/test/Parser/cxx-using-directive.cpp'
FAILED! ********************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.semaheap
Type: application/octet-stream
Size: 540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090518/7ec46b2c/attachment.obj>


More information about the cfe-dev mailing list