Null pointer access (revision 824, PS3)

Started by
14 comments, last by WitchLord 12 years, 11 months ago
Hello,

Before I updated to revision 824 (I was at 781 before) it was working and now it does not anymore, I guess it is because of the changes in as_callfunc_ppc_64.cpp which is used on PS3.

Level.fluidBarycenterSmooth = 0.5f;

and Level is defined as :

engine->RegisterGlobalFunction("LevelType& get_Level()", asFUNCTION(Level::instance), asCALL_CDECL);

Now this triggers a null pointer access exception each time Level is accessed.

Remi Gillig.
Advertisement
I personally implement Level (in my case, "Stage") functions as global functions rather than directly through an instance. Have C functions wrap the Level::instance()->Foo() stuff and just expose them globally.

I know, I am just so helpful aren't I?:rolleyes:
It's been around 8 months that everything worked very well, I just updated to the latest revision and it crashes now. I hope it is because of the recent changes in as_callfunc_*.cpp.

It's been around 8 months that everything worked very well, I just updated to the latest revision and it crashes now. I hope it is because of the recent changes in as_callfunc_*.cpp.

Yes, i confirm, program works not properly. But after change back 'emms' to 'fninit' all works fine.
I knew the changes in as_callfunc had a high risk of breaking something. Unfortunately I had to take this risk in orde to make important improvements towards memory consumption and performance.

I'll need help in fixing these problems though, because I do not have a platform to test the ppc_64.cpp code. Can you help me find the error?

The change from fninit to emms was done because I got a bug report on the code breaking with fninit. Now I'm lost, which should really be used?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I said about as_callfunc_x86.cpp and revision 822.
I know. That's the only place fninit was used, still I don't understand why you need it to be fninit, and the other developer need it to be emms. Nor do I have any idea as to how I'm go to solve it for both of you.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

The changes that must have broken the PS3 code is from revision 795.

diff for this version

I'm not quite sure yet, what the error is.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game


I know. That's the only place fninit was used, still I don't understand why you need it to be fninit, and the other developer need it to be emms. Nor do I have any idea as to how I'm go to solve it for both of you.

Don't bother about me, i change it myself, but you keep it mind for future.

About bug - don't know what happens, but program works not correct - many fails in places where it not can be, also this fails not in AS related code. Than i rebuild with 'emms'->'fninit' and program works without fails.

Also sorry that i wrote off-topic, missed that topic of the PS3.

Hello,

Before I updated to revision 824 (I was at 781 before) it was working and now it does not anymore, I guess it is because of the changes in as_callfunc_ppc_64.cpp which is used on PS3.

Level.fluidBarycenterSmooth = 0.5f;

and Level is defined as :

engine->RegisterGlobalFunction("LevelType& get_Level()", asFUNCTION(Level::instance), asCALL_CDECL);

Now this triggers a null pointer access exception each time Level is accessed.

Remi Gillig.


I reviewed the as_callfunc_ppc_64.cpp code, and for this very simple function I didn't see anything wrong. Maybe the problem is with property accessors, instead. Can you give the following code a try, just to see if it passes:

get_Level().fluidBarycenterSmooth = 0.5f;

That is, call the property accessor explicitly as a normal function. If the problem is with the property accessors rather than the native calling, then the scripts should be able to call the functions directly.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement