fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Compiler assertion: passing args: byref should not clone into temps

Compiler assertion: passing args: byref should not clone into temps 4 months 3 weeks ago #8131

  pemo18's Avatar Topic Author pemo18 Offline Posts: 16
Hello X#-Compiler team,

I am working on a large x# project and recently I get a dozens of compiler assertions that do not make sense to me.

The projects gets compiled but I have to click on a dozens dialog boxes every time (system beep included).

The assert message is : passing args: byref should not clone into temps

Is this due to my code or a bug in the compiler?

Regards,
Peter
Attachments:

Please Log in or Create an account to join the conversation.

Compiler assertion: passing args: byref should not clone into temps 4 months 3 weeks ago #8132

  robert's Avatar robert Offline Posts: 1085
Peter,
I guess you are using the public build 2.0.0.8 (it is a good idea to include this info in a message):
public builds include the debug version of the compiler which has assertions enabled.
What you see is an assertion message.
I think you are passing a literal value to a function or method that expects a variable by reference. The compiler then has to create a temporary variable and pass its address by reference. The roslyn developers have created an assertion for this.
If you send us your code we can tell you exactly where the problem is and then we can most likely create a better error or warning for this.
Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Compiler assertion: passing args: byref should not clone into temps 4 months 3 weeks ago #8133

  pemo18's Avatar Topic Author pemo18 Offline Posts: 16
Hello Robert,

Sorry, I forgot the most important piece of information - I am using version 2.0.8.

I cannot provide the source code because right now I have no idea which method or function cause the assertion. And I am not using any ref parameter explicitly.

Are there any compiler log files may be?

Another issue is that some projects compile with 0 errors and 0 warnings but with a "Fehler" without any details about the error.

Kind regards (and thank you for taking your time for this minor issue)
,
Peter

Please Log in or Create an account to join the conversation.

Compiler assertion: passing args: byref should not clone into temps 4 months 3 weeks ago #8134

  robert's Avatar robert Offline Posts: 1085
Peter
> Another issue is that some projects compile with 0 errors and 0 warnings but with a "Fehler" without any details about the error.
This maybe caused by the same problem.
Without seeing your source I can't really say what causes this. If you are allowed to then please zip all the source and mail it to me or Chris. If you want us to sign an NDA first then that's fine.
I am sure that WITH the source we'll find the cause of the problems very quickly. Otherwise it will be virtually impossible.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Compiler assertion: passing args: byref should not clone into temps 4 months 3 weeks ago #8137

  Chris's Avatar Chris Offline Posts: 1269
Peter,

This is a small sample code that was producing this assertion dialog in build 2.0.8:
	LOCAL n AS INT
	Default(@n , 123) // assertion dialog here

This is now fixed in 2.0.9, there's a proper error message that the first param to Default() must be a USUAL, not an INT.

Maybe you can check your code about such incorrect calls to Default(), or any other function/method that requires a usual by reference. If not, as Robert said, only way to find the problem is for you to send up the code to have a look.
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Compiler assertion: passing args: byref should not clone into temps 2 months 2 weeks ago #9207

  pemo18's Avatar Topic Author pemo18 Offline Posts: 16
Hello Chris,

I just want to inform you that the compiler assertions error message still persists - in the meantime I have to click away > 100 error messageboxes for each compile! But this happens only on one machine (otherwise I would have given up;). Not on others. But since this my developer pc I wish there would be some way to avoid getting all the error messages.

I have to stick with Bandol 2.0.8 for the moment until the final version will be avaliable.

Kind regards,
Peter

PS: I was not able to make the small sample code you have included to compile. Something was missing.

Please Log in or Create an account to join the conversation.

Compiler assertion: passing args: byref should not clone into temps 2 months 2 weeks ago #9208

  Chris's Avatar Chris Offline Posts: 1269
Hi Peter,

It's only "debug" builds (distributed with the public X# versions) that show those dialogs (unintentionally), please install X# with the installer found in the subscribers download area and you will not get the messages any more.

The sample was not meant to compile, this is indeed not allowed:

FUNCTION Start() AS VOID
LOCAL n AS INT
Default(@n , 123) // error cannot convert INT to USUAL

Default() only works with USUAL vars by design, so if you are using non-USUALS in it, then you need to adjust the code.
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Compiler assertion: passing args: byref should not clone into temps 2 months 2 weeks ago #9209

  pemo18's Avatar Topic Author pemo18 Offline Posts: 16
Hello Chris,

I was not aware that I was using a debug build. I re-installed the X#-Sharp Compiler and no more dialogboxes:)

Thank you for your help,
www.xsharp.info/forum/public-product/110...nto-temps/reply/9208
Peter

Please Log in or Create an account to join the conversation.

  • Page:
  • 1