From ed17838a1f33d5b9f525b359c9e481722a8962a9 Mon Sep 17 00:00:00 2001 From: Andrey Ponomarenko Date: Fri, 7 Jun 2013 16:07:44 +0400 Subject: Support for ABI Dumper 0.97 --- modules/Internals/CallConv.pm | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'modules/Internals') 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}; } -- cgit v1.2.3