8146244: compiler/jvmci/code/DataPatchTest.java crashes: SIGSEGV in (getConstClass)getConstClass

Reviewed-by: twisti
This commit is contained in:
Roland Schatz 2016-01-21 16:22:01 +01:00
parent a5d7b2b450
commit 0691fac50b
2 changed files with 22 additions and 1 deletions

View file

@ -295,6 +295,15 @@ public abstract class TestAssembler {
data.putFloat(f);
}
public void align(int alignment) {
int pos = data.position();
int misaligned = pos % alignment;
if (misaligned != 0) {
pos += alignment - misaligned;
data.position(pos);
}
}
private byte[] finish() {
return Arrays.copyOf(data.array(), data.position());
}