<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - MemorySanitizer: use of uninitialized value (CalleeWithThisReturn) in CodeGenFunction::EmitFunctionEpilog"
   href="http://llvm.org/bugs/show_bug.cgi?id=15598">15598</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>MemorySanitizer: use of uninitialized value (CalleeWithThisReturn) in CodeGenFunction::EmitFunctionEpilog
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>eugeni.stepanov@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>MemorySanitizer report:

WARNING: Use of uninitialized value
    #0 0x7f90105f9b2b in
clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(clang::CodeGen::CGFunctionInfo
const&) tools/clang/lib/CodeGen/CGCall.cpp:1727
    #1 0x7f90103b8e98 in
clang::CodeGen::CodeGenFunction::FinishFunction(clang::SourceLocation)
tools/clang/lib/CodeGen/CodeGenFunction.cpp:207
    #2 0x7f901039bc92 in
clang::CodeGen::CodeGenFunction::GenerateThunk(llvm::Function*,
clang::CodeGen::CGFunctionInfo const&, clang::GlobalDecl, clang::ThunkInfo
const&) tools/clang/lib/CodeGen/CGVTables.cpp:379
    #3 0x7f901039e7af in
clang::CodeGen::CodeGenVTables::EmitThunk(clang::GlobalDecl, clang::ThunkInfo
const&, bool) tools/clang/lib/CodeGen/CGVTables.cpp:456
    #4 0x7f901039fca9 in
clang::CodeGen::CodeGenVTables::EmitThunks(clang::GlobalDecl)
tools/clang/lib/CodeGen/CGVTables.cpp:493
    #5 0x7f9010403c08 in
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl)
tools/clang/lib/CodeGen/CodeGenModule.cpp:1227
    #6 0x7f90103eeeb7 in clang::CodeGen::CodeGenModule::EmitDeferred()
tools/clang/lib/CodeGen/CodeGenModule.cpp:896
    #7 0x7f90103ee5ac in clang::CodeGen::CodeGenModule::Release()
tools/clang/lib/CodeGen/CodeGenModule.cpp:180
    #8 0x7f9010383415 in (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
tools/clang/lib/CodeGen/ModuleBuilder.cpp:104
    #9 0x7f901037fa36 in
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
tools/clang/lib/CodeGen/CodeGenAction.cpp:119
    #10 0x7f901136202d in clang::ParseAST(clang::Sema&, bool, bool)
tools/clang/lib/Parse/ParseAST.cpp:153
    #11 0x7f9010f4d3ff in clang::ASTFrontendAction::ExecuteAction()
tools/clang/lib/Frontend/FrontendAction.cpp:470
    #12 0x7f901037b8db in clang::CodeGenAction::ExecuteAction()
tools/clang/lib/CodeGen/CodeGenAction.cpp:423
    #13 0x7f9010f4af2c in clang::FrontendAction::Execute()
tools/clang/lib/Frontend/FrontendAction.cpp:378
    #14 0x7f9010e97455 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
tools/clang/lib/Frontend/CompilerInstance.cpp:691
    #15 0x7f90102f2a86 in
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:235
    #16 0x7f900bc29082 in cc1_main(char const**, char const**, char const*,
void*) tools/clang/tools/driver/cc1_main.cpp:98
    #17 0x7f900bc150ea in main tools/clang/tools/driver/driver.cpp:357
    #18 0x7f900a0db76c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c)
    #19 0x7f900bc11d0c (/code/llvm/build_msan/bin/clang-3.3+0x43ed0c)
  Uninitialized value was created by an allocation of 'temp.lvalue73' in the
stack frame of function
'clang::CodeGen::CodeGenVTables::EmitThunk(clang::GlobalDecl, clang::ThunkInfo
const&, bool)'


This can be verified by initializing CalleeWithThisReturn with garbage in
CodeGenFunction::CodeGenFunction(), and verifying that it is still there in
CodeGenFunction::EmitFunctionEpilog.

This code was introduced in r177541.
r178015 fixed a minor issue here, but this time
CGM.getCXXABI().HasThisReturn(CurGD) is true, and this uninitialized value may
actually affect generated code.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>