Make alignment checks adjustable - coincidently fixing a bug with that test

This commit is contained in:
Hamish Coleman 2017-01-06 14:38:28 +00:00
parent 890d7e8252
commit 90ce5a1978

View File

@ -238,9 +238,9 @@ sub validate_pointer {
my $db = shift;
my $val = shift;
# Check it is aligned to 32bits
# FIXME - compare against db->{sizes}{align}, not hardcoded
if (!$val & 0x3) {
# Check it is correctly aligned
# FIXME - this only works for binary values of alignment
if (($val & ($db->{sizes}{align}-1)) != 0) {
return undef;
}