Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
386f34c7
Commit
386f34c7
authored
Apr 07, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix -fno-exceptions after bounded-types change.
parent
45442498
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
layout.c++
c++/src/capnp/layout.c++
+13
-7
No files found.
c++/src/capnp/layout.c++
View file @
386f34c7
...
...
@@ -1617,7 +1617,7 @@ struct WireHelpers {
}
}
else
{
word
*
ptr
=
followFars
(
ref
,
refTarget
,
segment
);
char
*
cptr
=
reinterpret_cast
<
char
*>
(
ptr
);
byte
*
bptr
=
reinterpret_cast
<
byte
*>
(
ptr
);
KJ_REQUIRE
(
ref
->
kind
()
==
WirePointer
::
LIST
,
"Called getText{Field,Element}() but existing pointer is not a list."
)
{
...
...
@@ -1628,13 +1628,19 @@ struct WireHelpers {
goto
useDefault
;
}
size_t
size
=
unbound
(
subtractChecked
(
ref
->
listRef
.
elementCount
()
/
ELEMENTS
,
ONE
,
[]()
{
KJ_FAIL_REQUIRE
(
"zero-size blob can't be text (need NUL terminator)"
);
}));
KJ_REQUIRE
(
cptr
[
size
]
==
'\0'
,
"Text blob missing NUL terminator."
)
{
goto
useDefault
;
}
auto
maybeSize
=
trySubtract
(
ref
->
listRef
.
elementCount
()
*
(
ONE
*
BYTES
/
ELEMENTS
),
ONE
*
BYTES
);
KJ_IF_MAYBE
(
size
,
maybeSize
)
{
KJ_REQUIRE
(
*
(
bptr
+
*
size
)
==
'\0'
,
"Text blob missing NUL terminator."
)
{
goto
useDefault
;
}
return
Text
::
Builder
(
cptr
,
size
);
return
Text
::
Builder
(
reinterpret_cast
<
char
*>
(
bptr
),
unbound
(
*
size
/
BYTES
));
}
else
{
KJ_FAIL_REQUIRE
(
"zero-size blob can't be text (need NUL terminator)"
)
{
goto
useDefault
;
};
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment