On Sun, 2005-10-23 at 09:02 +0200, Nicolas Cannasse wrote:
> > > > Uncaught exception - load.c(426) : Invalid module : Nekoml/Main

> The first LONG readed should be the magic number 0x4F4B454E ( NEKO )
> Maybe some byte ordering problem ?

Hmm:

static neko_module *neko_module_read( reader r, readp p, value loader )
{
        unsigned int i;
        unsigned int itmp;
        unsigned char t;
        unsigned short stmp;
        char *tmp = NULL;
        int entry;
        neko_module *m = (neko_module*)alloc(sizeof(neko_module));
        READ_LONG(itmp);
  printf("itmp=%08x\n",itmp);
        if( itmp != 0x4F4B454E )
                ERROR();
  printf("OK, files starts with NEKO\n");

(cd src && LD_LIBRARY_PATH=../bin NEKOPATH=../boot ../bin/nekovm
Nekoml/Main Neko/Main.nml Nekoml/Main.nml)
sizeof(value)=8
sizeof(int_val)=8
sizeof(int)=4
sizeof(val_type)=4
sizeof(struct _value)=4
4e (N) 45 (E) 4b (K) 4f (O) -> 4f4b454e=4f4b454e
itmp=00000000
OK, files starts with NEKO
...


BUT:
        READ_LONG(itmp);
  //printf("itmp=%08x\n",itmp);
        if( itmp != 0x4F4B454E )
                ERROR();
  printf("OK, files starts with NEKO\n");

when I comment out the debug print ..

(cd src && LD_LIBRARY_PATH=../bin NEKOPATH=../boot ../bin/nekovm
Nekoml/Main Neko/Main.nml Nekoml/Main.nml)
sizeof(value)=8
sizeof(int_val)=8
sizeof(int)=4
sizeof(val_type)=4
sizeof(struct _value)=4
4e (N) 45 (E) 4b (K) 4f (O) -> 4f4b454e=4f4b454e
Uncaught exception - load.c(435) : Invalid module : Nekoml/Main

Now, when I recompile without -O3, then it gets further.

(cd src && LD_LIBRARY_PATH=../bin NEKOPATH=../boot ../bin/nekovm
Nekoml/Main Neko/Main.nml Nekoml/Main.nml)
sizeof(value)=8
sizeof(int_val)=8
sizeof(int)=4
sizeof(val_type)=4
sizeof(struct _value)=4
4e (N) 45 (E) 4b (K) 4f (O) -> 4f4b454e=4f4b454e
OK, files starts with NEKO
sizeof(value)=8
sizeof(int_val)=8
sizeof(int)=4
sizeof(val_type)=4
sizeof(struct _value)=4
1f (^_) 00 (^@) 00 (^@) 00 (^@) -> 0000001f=0000001f
sizeof(value)=8
sizeof(int_val)=8
sizeof(int)=4
sizeof(val_type)=4
sizeof(struct _value)=4
1f (^_) 00 (^@) 00 (^@) 00 (^@) -> 0000001f=0000001f
sizeof(value)=8
sizeof(int_val)=8
sizeof(int)=4
sizeof(val_type)=4
sizeof(struct _value)=4
75 (u) 02 (^B) 00 (^@) 00 (^@) -> 00000275=00000275
sizeof(value)=8
sizeof(int_val)=8
sizeof(int)=4
sizeof(val_type)=4
sizeof(struct _value)=4
02 (^B) 00 (^@) 00 (^@) 02 (^B) -> 02000002=02000002
sizeof(value)=8
sizeof(int_val)=8
sizeof(int)=4
sizeof(val_type)=4
sizeof(struct _value)=4
36 (6) 00 (^@) 00 (^@) 02 (^B) -> 02000036=02000036
Uncaught exception - load.c(435) : Invalid module : Nekoml/Main


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

---
Neko : One VM to run them all

Reply via email to