-
Notifications
You must be signed in to change notification settings - Fork 159
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
[onert-micro] Resolve svace warning #13557
Conversation
This commit resolves warnings from static analysis reported by svace. Signed-off-by: Jungwoo Lee <[email protected]>
@@ -42,7 +42,7 @@ void configure_kernel_CircleExpandDims(const circle::Operator *cur_op, | |||
auto axis_data = runtime_graph->getConstDataByTensor(axis); | |||
assert(axis_data != nullptr); | |||
|
|||
int32_t axis_value; | |||
int32_t axis_value = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uninitialized data is read from local variable 'axis_value' at ExpandDims.cpp:59.
@@ -417,6 +417,7 @@ uint8_t *RuntimeGraph::getConstDataByTensor(const circle::Tensor *raw_tensor) | |||
#endif // ENABLE_TRAINING | |||
|
|||
auto const &buffer = wrap(_reader->buffers()[raw_tensor->buffer()]->data()); | |||
assert(buffer.data() != nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a function 'luci_interpreter::RuntimeGraph::getConstDataByTensor' is dereferenced at While.cpp:110 without checking for null
@@ -69,6 +69,7 @@ void UnpackImpl(const circle::Operator *cur_op, const circle::Tensor *input, int | |||
const auto t = runtime_graph->getCircleTensorByIndex(output_index); | |||
assert(output0 != nullptr); | |||
T *output_data = kernels::getTensorData<T>(runtime_graph->getDataByTensor(t)); | |||
assert(output_data != nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
luci_interpreter::kernels::getTensorData' is dereferenced at Unpack.cpp:78 without checking for null
Need to be changed to if~else or throw since |
luci-interpreter might be deprecated. |
This commit resolves warnings from static analysis reported by svace.
Signed-off-by: Jungwoo Lee [email protected]