Skip to content

Commit faf19c4

Browse files
ebicklemhdawson
authored andcommitted
Fixed initialization of std::string to nullptr
Enabled VC++ static analysis PR-URL: #228 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
1 parent 9c4d321 commit faf19c4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

napi-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,7 @@ inline NAPI_NO_RETURN void Error::Fatal(const char* location, const char* messag
18201820
napi_fatal_error(location, NAPI_AUTO_LENGTH, message, NAPI_AUTO_LENGTH);
18211821
}
18221822

1823-
inline Error::Error() : ObjectReference(), _message(nullptr) {
1823+
inline Error::Error() : ObjectReference() {
18241824
}
18251825

18261826
inline Error::Error(napi_env env, napi_value value) : ObjectReference(env, nullptr) {

test/binding.gyp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
'cflags!': [ '-fno-exceptions' ],
3434
'cflags_cc!': [ '-fno-exceptions' ],
3535
'msvs_settings': {
36-
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
36+
'VCCLCompilerTool': {
37+
'ExceptionHandling': 1,
38+
'EnablePREfast': 'true',
39+
},
3740
},
3841
'xcode_settings': {
3942
'CLANG_CXX_LIBRARY': 'libc++',
@@ -47,7 +50,10 @@
4750
'cflags': [ '-fno-exceptions' ],
4851
'cflags_cc': [ '-fno-exceptions' ],
4952
'msvs_settings': {
50-
'VCCLCompilerTool': { 'ExceptionHandling': 0 },
53+
'VCCLCompilerTool': {
54+
'ExceptionHandling': 0,
55+
'EnablePREfast': 'true',
56+
},
5157
},
5258
'xcode_settings': {
5359
'CLANG_CXX_LIBRARY': 'libc++',

0 commit comments

Comments
 (0)