Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/io/async_io_parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ namespace vsag {
AsyncIOParameter::AsyncIOParameter() : IOParameter(IO_TYPE_VALUE_ASYNC_IO) {
}

AsyncIOParameter::AsyncIOParameter(const vsag::JsonType& json)
: IOParameter(IO_TYPE_VALUE_BUFFER_IO) {
AsyncIOParameter::AsyncIOParameter(const vsag::JsonType& json) : AsyncIOParameter() {
this->FromJson(json); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FromJson appears to be virtual (per the NOLINT), and calling virtual functions from constructors can cause surprising behavior if AsyncIOParameter is used as a base class (virtual dispatch won’t reach further-derived overrides during base construction). Consider making the class final, making FromJson non-virtual, or moving JSON parsing into a non-virtual helper/static factory that runs after full object construction.

Suggested change
this->FromJson(json); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall)
CHECK_ARGUMENT(json.Contains(IO_FILE_PATH_KEY), "miss file_path param in async io type");
this->path_ = json[IO_FILE_PATH_KEY].GetString();

Copilot uses AI. Check for mistakes.
}

Expand Down
Loading