ChakraCore
                                
                                 ChakraCore copied to clipboard
                                
                                    ChakraCore copied to clipboard
                            
                            
                            
                        `this == nullptr` results in undefined behavior
Issue
‘this’ pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
Tasks
- [ ] Add compiler warning
clang: -Wundefined-bool-conversionmsvc: ??
- [x] #6847
- [ ] IR.cpp
- [x] Find further places where this may happen
This warning should now be enabled in Clang by default, though didn't catch this earlier due to -Werror, I suspect it wasn't enabled in the version from the package manager.
https://github.com/chakra-core/ChakraCore/blob/2af598f04ab508f9231d6e26f0f82f5a57561413/lib/Backend/IR.cpp#L4852
I had a look IR.cpp and the invalid check is being done part of a Debug only feature; so it's not as critical a concern as ImmutableList.
I've also done a sequence of searches in the codebase and I don't think there's anything else.