HISE Logo Forum
    • Categories
    • Register
    • Login

    SNEX unsafe access, again?

    Scheduled Pinned Locked Moved Scripting
    2 Posts 1 Posters 97 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustkU
      ustk
      last edited by ustk

      @Christoph-Hart Getting an unsafe access warning when branching, while it is working just above that branch.
      So if I comment out the if statement, or replace with if(true), no more warning...
      Is that me not understanding and making a mistake with isClassB bool?

      	
      span<span<ClassA, MAX_NUM_CHANNELS>, 2> classB;
      
      index::clamped<MAX_NUM_CHANNELS, false> idx;
      
      bool isClassB = false;
      
      
      template <typename ProcessDataType> void process(ProcessDataType& data)
      {
      	const int nbChannels = Math.min(data.getNumChannels(), MAX_NUM_CHANNELS);
      	
      	for (int i = 0; i<nbChannels; i++)
      	{
      		idx = i;
      		
      		for (auto& s: data[i])
      		{
      			s = classB[PUSH][idx].processSample(s) ;
      			
      			if (isClassB)
      				s = classB[PULL][idx].processSample(s) ; // unsafe access because of idx
      		}
      	}
      }
      

      Can't help pressing F5 in the forum...

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @ustk
        last edited by

        @Christoph-Hart Bump 🤗

        Can't help pressing F5 in the forum...

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        15

        Online

        1.7k

        Users

        11.8k

        Topics

        102.3k

        Posts