-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
wasm: add missing init reported by coverity #42897
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Michael Dawson <mdawson@devrus.com>
Report from coverity: 26 private:
27 WasmStreamingObject(Environment* env, v8::Local<v8::Object> object)
28 : BaseObject(env, object) {
29 MakeWeak();
CID 254660 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member wasm_size_ is not initialized in this constructor nor in any functions that it calls.
30 }
31
32 ~WasmStreamingObject() override {}
33
34 private:
35 static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
36 static void SetURL(const v8::FunctionCallbackInfo<v8::Value>& args);
37 static void Push(const v8::FunctionCallbackInfo<v8::Value>& args);
38 static void Finish(const v8::FunctionCallbackInfo<v8::Value>& args);
39 static void Abort(const v8::FunctionCallbackInfo<v8::Value>& args);
40
41 std::shared_ptr<v8::WasmStreaming> streaming_;
1. member_decl: Class member declaration for wasm_size_.
42 size_t wasm_size_;
43}; |
lpinca
approved these changes
Apr 28, 2022
VoltrexKeyva
approved these changes
Apr 28, 2022
cjihrig
approved these changes
Apr 28, 2022
Mesteery
approved these changes
Apr 28, 2022
FWIW, this is where the initialization currently happens: Lines 58 to 70 in 68fb0bf
Other functions rely on the assumption that the initialization ran (e.g., will abort the process if Eventually, we might want to revisit how we initialize C++ backed JS objects in general. |
This was referenced May 3, 2022
mhdawson
added a commit
that referenced
this pull request
May 10, 2022
Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #42897 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
Landed in 7649989 |
BethGriggs
pushed a commit
that referenced
this pull request
May 16, 2022
Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #42897 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
Merged
Backport refs: #42701 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Michael Dawson mdawson@devrus.com