[Fontconfig] Re: Crash with fontconfig 2.3.92

sunmoon1997 sunmoon1997 at gmail.com
Thu Nov 17 16:02:19 PST 2005


From my understanding, FcConfigValues recurrently calls itself and 
constructs a value list and removes any void value in the list.
But it checks the list in reversed order, that is from tail to head.
The current implementation of FcConfigValues, it iterates from the
current node to list tail, you can see it checks the node already
checked.
1 2 3 4 5
=-=-=-=-=
        = 1 checking node(s) 5
      =-= 2                  4 - 5
    =-=-= 3                  3 - 5
  =-=-=-= 4                  2 - 5
=-=-=-=-= 5                  1 - 5

After removing the iteration, the code will work like 
following.
1 2 3 4 5
=-=-=-=-= 
        = 1 checking node 5(if it's a void value, then drops this node)
      =   2               4 ...
    =     3               3 ...
  =       4               2 ...
=         5               1 ...

I think it's simpler and is still correct.
Am i correct?

在 2005-11-17四的 11:08 -0500,Patrick Lam写道:
> sunmoon1997 wrote:
> > this one shoule be better;)
> > 在 2005-11-17四的 11:00 +0100,Frederic Crozat写道:
> > 
> >>Le jeudi 17 novembre 2005 à 17:34 +0800, sunmoon1997 a écrit :
> >>
> >>>here is a impoved one.:)
> >>
> >>Nice fix, I can confirm it fixes the crash. Thanks a lot.
> >>
> >>Could Patrick or Keith commit both my warning output patch and sunmoon
> >>crash fixes, both are useful..
> 
> I'll commit the warning output patch.  I'm a bit confused by sunmoon's
> crash fix, I don't really understand why it works.  I'm going to take a
> bit more of a look at it; sunmoon, can you comment on why it works?
> 
> pat
-- 
Jinghua Luo <sunmoon1997 at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: =?UTF-8?Q?=E8=BF=99=E6=98=AF=E4=BF=A1=E4=BB=B6=E7=9A=84=E6=95=B0?=
	=?UTF-8?Q?=E5=AD=97=E7=AD=BE=E5=90=8D=E9=83=A8=E5=88=86?=
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20051118/5d8f4b61/attachment.pgp


More information about the Fontconfig mailing list