Advertisement

Passing literal as non-const reference

Started by August 25, 2009 05:39 AM
2 comments, last by WitchLord 15 years, 3 months ago
Hello, Simple repro:

void Repro(uint& val)
{
	val = 1;
}
Then pass const (literal) to the function:

Repro(0);
Compiler does not say anything, but runtime crashes.
Is Repro a scripted function or a registered function?


I'll look into this bug.

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
It's script function.
Thanks. I've fixed this bug now.

The compiler will now give a proper error when trying to call the function expecting a modifiable reference with a constant.

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