Advertisement

The compiler crashes

Started by May 16, 2016 04:40 AM
5 comments, last by IronHawk 8 years, 6 months ago

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() {
}

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

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

Advertisement

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)

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

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

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!

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.

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

Advertisement

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!

This topic is closed to new replies.

Advertisement