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 01 Apr 2019 08:36 #8131

  • pemo18's Avatar

  • pemo18

  • Topic Author


  • Posts: 31
  • 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 01 Apr 2019 09:38 #8132

  • robert's Avatar

  • robert


  • Posts: 1678
  • 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

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

    Compiler assertion: passing args: byref should not clone into temps 01 Apr 2019 11:36 #8133

  • pemo18's Avatar

  • pemo18

  • Topic Author


  • Posts: 31
  • 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 01 Apr 2019 12:17 #8134

  • robert's Avatar

  • robert


  • Posts: 1678
  • 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

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

    Compiler assertion: passing args: byref should not clone into temps 01 Apr 2019 14:00 #8137

  • Chris's Avatar

  • Chris


  • Posts: 1878
  • 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 03 Jun 2019 12:50 #9207

  • pemo18's Avatar

  • pemo18

  • Topic Author


  • Posts: 31
  • 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 03 Jun 2019 20:33 #9208

  • Chris's Avatar

  • Chris


  • Posts: 1878
  • 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 04 Jun 2019 09:28 #9209

  • pemo18's Avatar

  • pemo18

  • Topic Author


  • Posts: 31
  • 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