# 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.

## 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 on other sites
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?

##### 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 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 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 on other sites
I said about as_callfunc_x86.cpp and revision 822.

##### 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 on other sites
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.

##### 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 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.

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
12
5. 5

• 14
• 9
• 22
• 9
• 31
• ### Forum Statistics

• Total Topics
632619
• Total Posts
3007491
• ### Who's Online (See full list)

There are no registered users currently online

×