aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/JSBackend/JSBackend.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp
index 4322be3c8c..8b7be4ac57 100644
--- a/lib/Target/JSBackend/JSBackend.cpp
+++ b/lib/Target/JSBackend/JSBackend.cpp
@@ -290,9 +290,8 @@ namespace {
if (IndexedFunctions.find(Name) != IndexedFunctions.end()) return IndexedFunctions[Name];
std::string Sig = getFunctionSignature(F->getFunctionType(), &Name);
FunctionTable& Table = ensureFunctionTable(F->getFunctionType());
- // use alignment info to avoid unnecessary holes. This is not optimal though,
- // (1) depends on order of appearance, and (2) really just need align for &class::method, see test_polymorph
- unsigned Alignment = F->getAlignment() || 1;
+ unsigned Alignment = F->getAlignment() || 1; // XXX this is wrong, it's always 1. but, that's fine in the ARM-like ABI we have which allows unaligned functions.
+ // the one risk is if someone forces a function to be aligned, and relies on that.
while (Table.size() % Alignment) Table.push_back("0");
unsigned Index = Table.size();
Table.push_back(Name);