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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Burst error BC0102: Unexpected internal compiler error

Discussion in 'Burst' started by tertle, Sep 24, 2021.

  1. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,541
    Accidentally ran into an internal burst compile error while refactoring some code.

    Error

    Simple repo code

    Code (CSharp):
    1. public struct TestData
    2. {
    3.     public int3 Min;
    4.     public int Size;
    5. }
    6.  
    7. [BurstCompile]
    8. private struct Repo : IJob
    9. {
    10.     public NativeReference<TestData> Root;
    11.  
    12.     public void Execute()
    13.     {
    14.         this.FailMethod((TestData*)this.Root.GetUnsafePtr());
    15.     }
    16.  
    17.     private void FailMethod(in TestData* node)
    18.     {
    19.         var aabb = new Unity.Mathematics.MinMaxAABB { Min = node->Min, Max = node->Size };
    20.     }
    21. }
    The issue is just the

    Code (CSharp):
    1. in TestData* node
    Removing the 'in' and burst compiles fine.

    This is a pretty irrelevant bug as the 'in' doesn't do anything on a pointer as far as I'm aware, I was just refactoring a method and accidentally left it on.

    Only reporting it just because as far as I'm aware this is technically valid code and the repo was very simple.
     
    Last edited: Sep 24, 2021
    MNNoxMortem and sheredom like this.
  2. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    Good find! I can repro it, so I'll fix it. Thanks!