-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
wasm: add missing init reported by coverity #42897
Conversation
Signed-off-by: Michael Dawson <[email protected]>
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}; |
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. |
Signed-off-by: Michael Dawson <[email protected]> PR-URL: #42897 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Mestery <[email protected]>
Landed in 7649989 |
Signed-off-by: Michael Dawson <[email protected]> PR-URL: #42897 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Mestery <[email protected]>
Backport refs: #42701 |
Signed-off-by: Michael Dawson [email protected]