Commit 959ad296 authored by Kenton Varda's avatar Kenton Varda

Clean up style and fix compile error occurring with just the right GCC flags.

parent 895ffa48
...@@ -2274,16 +2274,17 @@ PointerType PointerBuilder::getPointerType() { ...@@ -2274,16 +2274,17 @@ PointerType PointerBuilder::getPointerType() {
WirePointer* ptr = pointer; WirePointer* ptr = pointer;
WireHelpers::followFars(ptr, ptr->target(), segment); WireHelpers::followFars(ptr, ptr->target(), segment);
switch(ptr->kind()) { switch(ptr->kind()) {
case WirePointer::Kind::FAR: case WirePointer::FAR:
KJ_FAIL_REQUIRE(); KJ_FAIL_ASSERT("far pointer not followed?");
case WirePointer::Kind::STRUCT: case WirePointer::STRUCT:
return PointerType::STRUCT; return PointerType::STRUCT;
case WirePointer::Kind::LIST: case WirePointer::LIST:
return PointerType::LIST; return PointerType::LIST;
case WirePointer::Kind::OTHER: case WirePointer::OTHER:
// TODO: make sure we're only looking at capability pointers KJ_REQUIRE(ptr->isCapability(), "unknown pointer type");
return PointerType::CAPABILITY; return PointerType::CAPABILITY;
} }
KJ_UNREACHABLE;
} }
} }
...@@ -2381,16 +2382,17 @@ PointerType PointerReader::getPointerType() const { ...@@ -2381,16 +2382,17 @@ PointerType PointerReader::getPointerType() const {
SegmentReader* sgmt = segment; SegmentReader* sgmt = segment;
WireHelpers::followFars(ptr, refTarget, sgmt); WireHelpers::followFars(ptr, refTarget, sgmt);
switch(ptr->kind()) { switch(ptr->kind()) {
case WirePointer::Kind::FAR: case WirePointer::FAR:
KJ_FAIL_REQUIRE(); KJ_FAIL_ASSERT("far pointer not followed?");
case WirePointer::Kind::STRUCT: case WirePointer::STRUCT:
return PointerType::STRUCT; return PointerType::STRUCT;
case WirePointer::Kind::LIST: case WirePointer::LIST:
return PointerType::LIST; return PointerType::LIST;
case WirePointer::Kind::OTHER: case WirePointer::OTHER:
// TODO: make sure we're only looking at capability pointers KJ_REQUIRE(ptr->isCapability(), "unknown pointer type");
return PointerType::CAPABILITY; return PointerType::CAPABILITY;
} }
KJ_UNREACHABLE;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment