Re: [fpc-devel]free pascal trademark
Jonas Maebe wrote: On 14 aug 2004, at 11:38, Rimgaudas Laucius wrote: who is owner of Free Pascal trademark? I searched in the internet but did not found this. I need this info for my article. Is there a "Free Pascal" trademark? Afaik, nobody owns it. Or is someone trying to pull a GMail on us? :) (http://slashdot.org/article.pl?sid=04/08/14/1330208) Registering a trademark is only usefull if you want to use a name later afaik. As soon as a name is used/known in public, it is protected as it would be a registered trademark. That's also why Linus T. got the Linux trademark so easily. ___ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel]PowerPC, TypInfo
Jonas Maebe wrote: On 14 aug 2004, at 21:07, Mattias Gaertner wrote: The GetOrdProp is used to read boolean values. It reads a longint and applies "and $ff" to get only the lowest byte. Under PowerPC the boolean value is stored just like under i386 in the first byte. Reading the longint under i386 works, but of course it does not under powerpc. So, either the compiler is wrong or the GetOrdValue function is wrong. Which one should I report? I just found out, that this is also the case for ShortInt, SmallInt, Word and Byte, but not for enums. To me, the fact that it always reads a longint regardless of the size of the property seems to be inherently wrong. What if the last field of a class is a byte? Then you can read past the end of the class, possibly into unallocated memory causing a crash, no? No. Classes are always allocated on the heap so the memory block is always at least a multiple of 4. ___ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel]PowerPC, TypInfo
On 15 aug 2004, at 00:20, Florian Klaempfl wrote: To me, the fact that it always reads a longint regardless of the size of the property seems to be inherently wrong. What if the last field of a class is a byte? Then you can read past the end of the class, possibly into unallocated memory causing a crash, no? No. Classes are always allocated on the heap so the memory block is always at least a multiple of 4. So? What if the last field is a byte and is stored in the last byte of the e.g. 100 bytes that the class occupies? Keep in mind that getordprop does not necessarily read from a 4-byte aligned address. It simply reads 4 bytes from the start address of the field, and then ands the result with $ff if the size of the field was 1 byte. Jonas ___ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel]PowerPC, TypInfo
On Sun, 15 Aug 2004 00:20:47 +0200 Florian Klaempfl <[EMAIL PROTECTED]> wrote: > Jonas Maebe wrote: > > > > > On 14 aug 2004, at 21:07, Mattias Gaertner wrote: > > > >>> The GetOrdProp is used to read boolean values. It reads a longint and > >>> applies "and $ff" to get only the lowest byte. Under PowerPC the > >boolean>> value is stored just like under i386 in the first byte. Reading > >the>> longint under i386 works, but of course it does not under powerpc. > >>> > >>> So, either the compiler is wrong or the GetOrdValue function is wrong. > >>> > >>> Which one should I report? > >> > >> > >> I just found out, that this is also the case for ShortInt, SmallInt, > >Word> and Byte, but not for enums. > > > > > > To me, the fact that it always reads a longint regardless of the size of > > > > the property seems to be inherently wrong. What if the last field of a > > class is a byte? Then you can read past the end of the class, possibly > > into unallocated memory causing a crash, no? > > No. Classes are always allocated on the heap so the memory block is > always at least a multiple of 4. The longint is read from the start of the SmallInt, so if the class is packed, its adress is not a multiple of 4. Or are all class variables 4 byte aligned? Mattias ___ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel]PowerPC, TypInfo
Jonas Maebe wrote: On 15 aug 2004, at 00:20, Florian Klaempfl wrote: To me, the fact that it always reads a longint regardless of the size of the property seems to be inherently wrong. What if the last field of a class is a byte? Then you can read past the end of the class, possibly into unallocated memory causing a crash, no? No. Classes are always allocated on the heap so the memory block is always at least a multiple of 4. So? What if the last field is a byte and is stored in the last byte of the e.g. 100 bytes that the class occupies? Keep in mind that getordprop does not necessarily read from a 4-byte aligned address. It simply reads 4 bytes from the start address of the field, and then ands the result with $ff if the size of the field was 1 byte. Ops :) It seems I worked too much with my sparc ;) ___ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel]PowerPC, TypInfo
On Sun, 15 Aug 2004 03:18:59 +0200 Mattias Gaertner <[EMAIL PROTECTED]> wrote: > On Sat, 14 Aug 2004 23:59:55 +0200 Jonas Maebe <[EMAIL PROTECTED]> > wrote: > > > > > On 14 aug 2004, at 21:07, Mattias Gaertner wrote: > > > > >> The GetOrdProp is used to read boolean values. It reads a longint and > > >> applies "and $ff" to get only the lowest byte. Under PowerPC the > > >> boolean > > >> value is stored just like under i386 in the first byte. Reading the > > >> longint under i386 works, but of course it does not under powerpc. > > >[...] > > > I just found out, that this is also the case for ShortInt, SmallInt, > > > Word > > > and Byte, but not for enums. > > > > To me, the fact that it always reads a longint regardless of the size > > of the property seems to be inherently wrong. What if the last field of > > a class is a byte? Then you can read past the end of the class, > > possibly into unallocated memory causing a crash, no? > > Good point. > Looking at SetOrdProp, I see, that it works correct with PByte, PWord, > PLongInt. > So GetOrdProp is buggy. > > I will send a patch, when I completed the other tests. Attached patch was tested under i386 and ppc. Mattias fcl_objpas_patch.gz Description: GNU Zip compressed data
[fpc-devel]FPC Source Paths under darwin
Which system.pp is used for darwin/system.ppu? Mattias -- ___ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel]FPC Source Paths under darwin
On 15 aug 2004, at 18:19, Mattias Gaertner wrote: Which system.pp is used for darwin/system.ppu? rtl/bsd/system.pp Jonas ___ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel]FPC Source Paths under darwin
On Sun, 15 Aug 2004 18:29:52 +0200 Jonas Maebe <[EMAIL PROTECTED]> wrote: > > On 15 aug 2004, at 18:19, Mattias Gaertner wrote: > > > Which system.pp is used for darwin/system.ppu? > > rtl/bsd/system.pp Thanks. That was the missing piece. I just created an OnClick event by double clicking on a button. :) Mattias ___ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel