Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

IL2CPP unsafe NullCheck compilation errors, generated from an unsafe function

Discussion in 'iOS and tvOS' started by Harito, Mar 8, 2015.

  1. Harito

    Harito

    Joined:
    Mar 3, 2014
    Posts:
    22
    Hello,

    I'm using Unity 4.6.3p2 and Xcode 6.1.1.
    I'm getting compilation errors when building the IL2CPP output. A function, which has unsafe code generates (partly) the following output :

    NullCheck(((intptr_t)((((intptr_t)V_6))+((intptr_t)((intptr_t)(((intptr_t)V_0))*(int32_t)sizeof(Vector2_t71 ))))));
    float L_1 = (((intptr_t)((((intptr_t)V_6))+((intptr_t)((intptr_t)(((intptr_t)V_0))*(int32_t)sizeof(Vector2_t71 )))))->___x_1);

    Several of these lines are generating the same errors :
    No matching function for call to 'NullCheck'
    Member reference type 'intptr_t' (aka 'long') is not a pointer


    Respectively.
    Casting fixes it, but this would mean me going through each occurrence of this each time I compile and changing it manually. So I'm hoping something can be done for the next release?

    Thanks!
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Hi,

    could you report a bug with a script attached that causes IL2CPP generate this code?
     
  3. Harito

    Harito

    Joined:
    Mar 3, 2014
    Posts:
    22
    Hello,
    I submitted the case with a project that generates the code, it's Case 678978.

    Thanks!