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
a81ce929
Commit
a81ce929
authored
Dec 04, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix valgrind bugs.
parent
851f51e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
compiler.c++
c++/src/capnp/compiler/compiler.c++
+17
-7
dynamic.c++
c++/src/capnp/dynamic.c++
+1
-1
mega-test-quick.cfg
mega-test-quick.cfg
+3
-3
No files found.
c++/src/capnp/compiler/compiler.c++
View file @
a81ce929
...
...
@@ -179,6 +179,10 @@ private:
Content
guardedContent
;
// Read using getContent() only!
bool
inGetContent
=
false
;
// True while getContent() is running; detects cycles.
kj
::
Maybe
<
schema
::
Node
::
Reader
>
loadedFinalSchema
;
// Copy of `finalSchema` as loaded into the final schema loader. This doesn't go away if the
// workspace is destroyed.
// ---------------------------------------------
static
uint64_t
generateId
(
uint64_t
parentId
,
kj
::
StringPtr
declName
,
...
...
@@ -515,12 +519,11 @@ kj::Maybe<Compiler::Node::Content&> Compiler::Node::getContent(Content::State mi
}
}
// If the Workspace is destroyed while this Node is still in the BOOTSTRAP state,
// revert it to the EXPANDED state, because the NodeTranslator is no longer valid in this
// case.
// If the Workspace is destroyed, revert the node to the EXPANDED state, because the
// NodeTranslator is no longer valid in this case.
workspace
.
arena
.
copy
(
kj
::
defer
([
&
content
]()
{
content
.
bootstrapSchema
=
nullptr
;
if
(
content
.
state
==
Content
::
BOOTSTRAP
)
{
if
(
content
.
state
>
Content
::
EXPANDED
)
{
content
.
state
=
Content
::
EXPANDED
;
}
}));
...
...
@@ -640,7 +643,10 @@ kj::Maybe<Compiler::Node&> Compiler::Node::lookup(const DeclName::Reader& name)
}
kj
::
Maybe
<
Schema
>
Compiler
::
Node
::
getBootstrapSchema
()
{
KJ_IF_MAYBE
(
content
,
getContent
(
Content
::
BOOTSTRAP
))
{
KJ_IF_MAYBE
(
schema
,
loadedFinalSchema
)
{
// We don't need to rebuild the bootstrap schema if we already have a final schema.
return
module
->
getCompiler
().
getWorkspace
().
bootstrapLoader
.
loadOnce
(
*
schema
);
}
else
KJ_IF_MAYBE
(
content
,
getContent
(
Content
::
BOOTSTRAP
))
{
if
(
content
->
state
==
Content
::
FINISHED
&&
content
->
bootstrapSchema
==
nullptr
)
{
// The bootstrap schema was discarded. Copy it from the final schema.
// (We can't just return the final schema because using it could trigger schema loader
...
...
@@ -658,7 +664,9 @@ kj::Maybe<Schema> Compiler::Node::getBootstrapSchema() {
}
}
kj
::
Maybe
<
schema
::
Node
::
Reader
>
Compiler
::
Node
::
getFinalSchema
()
{
KJ_IF_MAYBE
(
content
,
getContent
(
Content
::
FINISHED
))
{
KJ_IF_MAYBE
(
schema
,
loadedFinalSchema
)
{
return
*
schema
;
}
else
KJ_IF_MAYBE
(
content
,
getContent
(
Content
::
FINISHED
))
{
return
content
->
finalSchema
;
}
else
{
return
nullptr
;
...
...
@@ -671,9 +679,11 @@ void Compiler::Node::loadFinalSchema(const SchemaLoader& loader) {
KJ_MAP
(
auxSchema
,
content
->
auxSchemas
)
{
return
loader
.
loadOnce
(
auxSchema
);
};
loade
r
.
loadOnce
(
*
finalSchema
);
loade
dFinalSchema
=
loader
.
loadOnce
(
*
finalSchema
).
getProto
(
);
}
}))
{
// Schema validation threw an exception.
// Don't try loading this again.
content
->
finalSchema
=
nullptr
;
...
...
c++/src/capnp/dynamic.c++
View file @
a81ce929
...
...
@@ -1346,7 +1346,7 @@ DynamicList::Reader DynamicList::Builder::asReader() const {
// =======================================================================================
DynamicValue
::
Reader
::
Reader
(
ConstSchema
constant
)
{
DynamicValue
::
Reader
::
Reader
(
ConstSchema
constant
)
:
type
(
VOID
)
{
auto
typeSchema
=
constant
.
getProto
().
getConst
().
getType
();
auto
value
=
constant
.
getProto
().
getConst
().
getValue
();
switch
(
typeSchema
.
which
())
{
...
...
mega-test-quick.cfg
View file @
a81ce929
linux-gcc-4.7 17
4
8 ./super-test.sh tmpdir capnp-gcc-4.7 quick
linux-gcc-4.8 17
5
1 ./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8
linux-clang 17
7
1 ./super-test.sh tmpdir capnp-clang quick clang
linux-gcc-4.7 17
5
8 ./super-test.sh tmpdir capnp-gcc-4.7 quick
linux-gcc-4.8 17
6
1 ./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8
linux-clang 17
8
1 ./super-test.sh tmpdir capnp-clang quick clang
mac 800 ./super-test.sh remote beat caffeinate quick
cygwin 805 ./super-test.sh remote Kenton@flashman quick
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