Jump to content
  • Advertisement
Sign in to follow this  
speps

Null pointer access (revision 824, PS3)

This topic is 2690 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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:

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!