fix bug in processEvent function
This commit is contained in:
parent
3b01ef99ae
commit
574190fb63
@ -395,9 +395,16 @@ class Impl : public dap::Session {
|
||||
auto data = new uint8_t[typeinfo->size()];
|
||||
typeinfo->construct(data);
|
||||
|
||||
if (!d->field("body", [&](dap::Deserializer* d) {
|
||||
return typeinfo->deserialize(d, data);
|
||||
})) {
|
||||
// "body" is an optional field for some events, such as "Terminated Event".
|
||||
bool body_ok = true;
|
||||
d->field("body", [&](dap::Deserializer* d) {
|
||||
if (!typeinfo->deserialize(d, data)) {
|
||||
body_ok = false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
if (!body_ok) {
|
||||
handlers.error("Failed to deserialize event '%s' body", event.c_str());
|
||||
typeinfo->destruct(data);
|
||||
delete[] data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user