Skip to content

Commit

Permalink
Merge: リリース (v2.0.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
vain0x committed Dec 23, 2019
2 parents e87e8b9 + b621000 commit 593608a
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Knowbug 変更履歴

## 2019-12-23

- v2.0.1 リリース
- 一定の条件下でクラッシュすることがある不具合を修正しました。

## 2019-12-22

- v2.0.0 リリース
Expand Down
61 changes: 61 additions & 0 deletions src/knowbug_client/kc_main.hsp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
assoc_get keys, values, value_lens, count, "version", version, version_len
if stat == false {
version = "v?.?.?"
version_len = strlen(version)
}

app_did_receive_hello_ok version
Expand All @@ -239,6 +240,10 @@

if method == "output_event" {
assoc_get keys, values, value_lens, count, "output", output, output_len
if stat == false {
output = ""
output_len = 0
}

app_did_receive_logmes output
return
Expand All @@ -256,16 +261,39 @@

if method == "location_event" {
assoc_get_int keys, values, value_lens, count, "source_file_id", source_file_id
if stat == false {
logmes "WARN: source_file_id missing"
return
}

assoc_get_int keys, values, value_lens, count, "line_index", line_index
if stat == false {
logmes "WARN: line_index missing"
return
}

app_did_receive_location source_file_id, line_index
return
}

if method == "source_event" {
assoc_get_int keys, values, value_lens, count, "source_file_id", source_file_id
if stat == false {
logmes "WARN: source_file_id missing"
return
}

assoc_get keys, values, value_lens, count, "source_path", source_path, source_path_len
if stat == false {
source_path = ""
source_path_len = 0
}

assoc_get keys, values, value_lens, count, "source_code", source_code, source_code_len
if stat == false {
source_code = ""
source_code_len = 0
}

app_did_receive_source_path source_file_id, source_path
app_did_receive_source_code source_file_id, source_code
Expand All @@ -274,18 +302,51 @@

if method == "list_updated_event" {
assoc_get keys, values, value_lens, count, "kind", kind, kind_len
if stat == false {
logmes "WARN: kind missing"
return
}

assoc_get_int keys, values, value_lens, count, "object_id", object_id
if stat == false {
logmes "WARN: object_id missing"
return
}

assoc_get_int keys, values, value_lens, count, "index", index
if stat == false {
logmes "WARN: index missing"
return
}

assoc_get keys, values, value_lens, count, "name", name, name_len
if stat == false {
name = ""
name_len = 0
}

assoc_get keys, values, value_lens, count, "value", value, value_len
if stat == false {
value = ""
value_len = 0
}

app_did_receive_list_update_ok kind, object_id, index, name, value
return
}

if method == "list_details_event" {
assoc_get_int keys, values, value_lens, count, "object_id", object_id
if stat == false {
logmes "WARN: object_id missing"
return
}

assoc_get keys, values, value_lens, count, "text", text, text_len
if stat == false {
text = ""
text_len = 0
}

app_did_receive_list_details_ok object_id, text
return
Expand Down
5 changes: 3 additions & 2 deletions src/knowbug_core/hsp_object_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ auto HspObjectPath::Group::name(HspObjects& objects) const->Utf8String {
if (offset() >= n) {
return to_owned(as_utf8(u8"..."));
}
assert(n >= 1);

auto first_index = offset();
auto last_index = std::min(n, offset() + MAX_CHILD_COUNT - 1);
assert(first_index < last_index);
auto last_index = std::min(n - 1, offset() + MAX_CHILD_COUNT - 1);
assert(first_index <= last_index);

auto name = parent().child_at(first_index, objects)->name(objects);
auto last = parent().child_at(last_index, objects)->name(objects);
Expand Down
5 changes: 5 additions & 0 deletions src/knowbug_core/hsp_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,11 @@ auto HspObjects::module_to_var_count(std::size_t module_id) const->std::size_t {
}

auto HspObjects::module_to_var_at(std::size_t module_id, std::size_t index) const->std::size_t {
if (index >= modules_.at(module_id).var_ids().size()) {
// FIXME: とりあえずクラッシュしないようにする。
return 0;
}

return modules_.at(module_id).var_ids().at(index);
}

Expand Down
2 changes: 1 addition & 1 deletion src/knowbug_dll/knowbug_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static constexpr auto MEMORY_BUFFER_SIZE = std::size_t{ 1024 * 1024 };
// バージョン
// -----------------------------------------------

static constexpr auto KNOWBUG_VERSION = u8"v2.0.0";
static constexpr auto KNOWBUG_VERSION = u8"v2.0.1";

#ifdef _M_X64
static constexpr auto KNOWBUG_PLATFORM_SUFFIX = u8" (x64)";
Expand Down

0 comments on commit 593608a

Please sign in to comment.