Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to virtual function during construction #28

Closed
pavelkryukov opened this issue Oct 8, 2018 · 0 comments
Closed

Call to virtual function during construction #28

pavelkryukov opened this issue Oct 8, 2018 · 0 comments

Comments

@pavelkryukov
Copy link
Contributor

pavelkryukov commented Oct 8, 2018

Found by Clang-Tidy 7:

/home/travis/build/MIPT-ILab/mipt-mips/simulator/../external/elfio/elfio_header.hpp:97:3: warning: Call to virtual function during construction [clang-analyzer-optin.cplusplus.VirtualCall]
                set_version( EV_CURRENT );
                ^
/home/travis/build/MIPT-ILab/mipt-mips/simulator/infra/memory/elf/elf_loader.cpp:27:18: note: Calling default constructor for 'elfio'
    ELFIO::elfio reader;
                 ^
/home/travis/build/MIPT-ILab/mipt-mips/simulator/../external/elfio/elfio.hpp:81:9: note: Calling 'elfio::create'
        create( ELFCLASS32, ELFDATA2LSB );
        ^
/home/travis/build/MIPT-ILab/mipt-mips/simulator/../external/elfio/elfio.hpp:95:18: note: Calling 'elfio::create_header'
        header = create_header( file_class, encoding );
                 ^
/home/travis/build/MIPT-ILab/mipt-mips/simulator/../external/elfio/elfio.hpp:314:9: note: 7991Taking false branch
        if ( file_class == ELFCLASS64 ) { warning
        ^
/home/travis/build/MIPT-ILab/mipt-mips/simulator/../external/elfio/elfio.hpp:318:14: note: Taking true branch
s        else if ( file_class == ELFCLASS32 ) {
             ^
/home/travis/build/MIPT-ILab/mipt-mips/simulator/../external/elfio/elfio.hpp:319:30: note: Calling constructor for 'elf_header_impl<ELFIO::Elf32_Ehdr>'
            new_header = new elf_header_impl< Elf32_Ehdr >( &convertor,
                             ^
/home/travis/build/MIPT-ILab/mipt-mips/simulator/../external/elfio/elfio_header.hpp:97:3: generated note: This constructor of an object of type 'elf_header_impl' has not returned when the virtual method was called
                set_version( EV_CURRENT );
                ^
/home/travis/build/MIPT-ILab/mipt-mips/simulator/../external/elfio/elfio_header.hpp:97:3: note: Call to virtual function during construction
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant