Jump to content
  • Advertisement
Sign in to follow this  
IronHawk

The compiler crashes

This topic is 782 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!
 
I found that the next small piece of code crashes the asIScriptModule Build() with Access Violation.
The code line m_callback = callback has an error obviously and should be changed to the one written in comment but still.
 
Many thanks!
 

funcdef void CALLBACK(MyParam@ param);

class MyParam {
    int m_value;

    MyParam(int value) {
        m_value = value;
    }
}

class MyClass {
    CALLBACK@ m_callback;

    MyClass(CALLBACK@ callback) {
        m_callback = callback; // !!! MUST BE: @m_callback = @callback;
    }
}

void main() {
}

Share this post


Link to post
Share on other sites
Advertisement

Are you using the latest WIP version from the SVN? I've already fixed a bug like this in the latest WIP version. 

 

 

Anyway, I'll make sure to test this too with the WIP to make sure it truly is fixed.

 

 

Regards,

Andreas

Share this post


Link to post
Share on other sites

Hello Andreas!

 

Are you using the latest WIP version from the SVN? I've already fixed a bug like this in the latest WIP version. 

 

Anyway, I'll make sure to test this too with the WIP to make sure it truly is fixed.

 

No, I use 2.31.0 with JIT.

As the problem isn't annoying I may wait till 2.32.0.

 

Thank you very much for such a good library!!!

(I compared the functionality with Lua and ChaiScript: in my opinion AngelScript is the best)

Share this post


Link to post
Share on other sites

As I suspected. This problem had already been fixed in the latest WIP version.

 

 

Thanks for the compliments on the library. Let me know if you encounter any other problems, or have any suggestions for how to improve the library further.

 

Regards,

Andreas

Share this post


Link to post
Share on other sites

Hello Andreas!
 

As I suspected. This problem had already been fixed in the latest WIP version.
 
Thanks for the compliments on the library. Let me know if you encounter any other problems, or have any suggestions for how to improve the library further.

 
Good to know that it's fixed already!
 
Regarding library improvement:
 
It's good to have more accurate info about source code positions in compiler error messages.
When AS source code uses tabs for indentation the '\t' char is now treated by the compiler as a single symbol

but in editor it may cover 2, 4 or even 8 symbols.
So something like

pEngine->SetEngineProperty(asEP_TAB_CHARACTER_SIZE, 4);

would be very good feature (in my opinion).
And if the default is 1 this change wont break any existing code.
 
Thanks a lot!

Share this post


Link to post
Share on other sites

I don't feel that this translation of tab chars to columns belongs in the compiler layer. One simple reason is that the compiler has no way of knowing if is compiling the original code or some code that has been pre-processed (for example to expand macros, etc).

 

I'll consider adding this translation to the CBuilder add-on though.

Share this post


Link to post
Share on other sites

I don't feel that this translation of tab chars to columns belongs in the compiler layer. One simple reason is that the compiler has no way of knowing if is compiling the original code or some code that has been pre-processed (for example to expand macros, etc).

 

I'll consider adding this translation to the CBuilder add-on though.

 

Well I don't know what's better but for example gcc/g++ 5.x assumes that tab size is 4 by default.

Also for preprocessor it has -ftabstop=width  option.

 

But any solution with such a translation is better than counting tabs as 1.

Thanks!

 

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!