aboutsummaryrefslogtreecommitdiff
path: root/modules/Internals
diff options
context:
space:
mode:
authorAndrey Ponomarenko <aponomarenko@rosalab.ru>2013-06-07 16:07:44 +0400
committerAndrey Ponomarenko <aponomarenko@rosalab.ru>2013-06-07 16:07:44 +0400
commited17838a1f33d5b9f525b359c9e481722a8962a9 (patch)
tree8c9087b7bf5bf2b6107bcf2ccb87a92e7980210d /modules/Internals
parent6ecc3c24482247066afd37e68b95e3f2076d5a3b (diff)
downloadabi-compliance-checker-ed17838a1f33d5b9f525b359c9e481722a8962a9.tar.gz
Support for ABI Dumper 0.97
Diffstat (limited to 'modules/Internals')
-rw-r--r--modules/Internals/CallConv.pm26
1 files changed, 19 insertions, 7 deletions
diff --git a/modules/Internals/CallConv.pm b/modules/Internals/CallConv.pm
index 23390e7..70582b2 100644
--- a/modules/Internals/CallConv.pm
+++ b/modules/Internals/CallConv.pm
@@ -38,6 +38,13 @@ my $BYTE = 8;
my %UsedReg = ();
my %UsedStack = ();
+my %IntAlgn = (
+ "x86"=>{
+ "double"=>4,
+ "long double"=>4
+ }
+);
+
sub classifyType($$$$$)
{
my ($Tid, $TInfo, $Arch, $System, $Word) = @_;
@@ -901,6 +908,12 @@ sub callingConvention_P_I_Model($$$$$$$)
sub getAlignment_Model($$$)
{
my ($Tid, $TInfo, $Arch) = @_;
+
+ if(not $Tid)
+ { # incomplete ABI dump
+ return 0;
+ }
+
if(defined $TInfo->{$Tid}{"Algn"}) {
return $TInfo->{$Tid}{"Algn"};
}
@@ -942,13 +955,6 @@ sub getAlignment_Model($$$)
}
}
-my %IntAlgn = (
- "x86"=>(
- "double"=>4,
- "long double"=>4
- )
-);
-
sub getInt_Algn($$$)
{
my ($Tid, $TInfo, $Arch) = @_;
@@ -1110,6 +1116,12 @@ sub isMemPadded($$$$$$)
}
}
($Alignment{$Pos}, $MSize{$Pos}) = getAlignment($Pos, $TypePtr, $TInfo, $Arch, $Word);
+
+ if(not $Alignment{$Pos})
+ { # emergency exit
+ return 0;
+ }
+
if($Alignment{$Pos}>$MaxAlgn) {
$MaxAlgn = $Alignment{$Pos};
}