Created
November 20, 2017 23:40
-
-
Save alexcrichton/8f5ddc7778586011eabe58aa2e11baeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/wasm/OutputSegment.h b/wasm/OutputSegment.h | |
index edee0ce..e0a76a9 100644 | |
--- a/wasm/OutputSegment.h | |
+++ b/wasm/OutputSegment.h | |
@@ -25,8 +25,8 @@ public: | |
void addInputSegment(InputSegment *Segment) { | |
Alignment = std::max(Alignment, Segment->getAlignment()); | |
InputSegments.push_back(Segment); | |
- Size = llvm::alignTo(Size, Segment->getAlignment()); | |
- ; | |
+ if (Segment->getAlignment() > 0) | |
+ Size = llvm::alignTo(Size, Segment->getAlignment()); | |
Segment->setOutputSegment(this, Size); | |
Size += Segment->getSize(); | |
} | |
@@ -36,7 +36,7 @@ public: | |
void setSectionOffset(uint32_t Offset) { SectionOffset = Offset; } | |
StringRef Name; | |
- uint32_t Alignment = 0; | |
+ uint32_t Alignment = 1; | |
uint32_t StartVA = 0; | |
std::vector<const InputSegment *> InputSegments; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment