mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
write alignment padding to output buffer in MyAssembler::writeTo
This commit is contained in:
parent
392a1417e5
commit
44ccd2b09e
14
src/x86.cpp
14
src/x86.cpp
@ -1569,7 +1569,19 @@ class MyAssembler: public Assembler {
|
||||
c.result = dst;
|
||||
|
||||
for (MyBlock* b = c.firstBlock; b; b = b->next) {
|
||||
memcpy(dst + b->start, c.code.data + b->offset, b->size);
|
||||
unsigned index = 0;
|
||||
for (AlignmentPadding* p = b->firstPadding; p; p = p->next) {
|
||||
unsigned size = p->offset - b->offset;
|
||||
memcpy(dst + b->start + index, c.code.data + b->offset + index, size);
|
||||
index += size;
|
||||
while ((b->start + index + 1) % 4) {
|
||||
*(dst + b->start + index) = 0x90;
|
||||
++ index;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(dst + b->start + index, c.code.data + b->offset + index,
|
||||
b->size - index);
|
||||
}
|
||||
|
||||
for (Task* t = c.tasks; t; t = t->next) {
|
||||
|
Loading…
Reference in New Issue
Block a user