SLP Code Protector Discussion For conversations regarding usage of Code Protector and issues pertaining to SVM protected code.
InishTech Support Forums > SLP Code Protector Discussion > Correctness error in protected code Login to add this as a favourite.
User avatar
Member
Member
adam.azarchs - 8/18/2010 12:49:11 AM
   
Correctness error in protected code

 The following code sample works fine unprotected, but the protected version throws an exception because the array is not being populated.

struct ValueHolder
{
    public byte value;
}

static void Main(string[] args)
{
    ValueHolder[] pairs = GeneratePairs();
    for (int i = 0; i < pairs.Length; i++)
    {
        if (pairs.value != i)
            throw new Exception("value " + i); // this throws on i >= 1
    }
        
    Console.WriteLine("Success!");
}

private static ValueHolder[] GenerateValues()
{
    ValueHolder[] ret = new ValueHolder[15];
    for (int i = 0; i < ret.Length; i++)
    {
        ret.value = (byte)i;
    }
    return ret;
}

We are running code protector version 3.0.1908.464.


User avatar
InishTech Dev
InishTech Dev
josullivan - 8/20/2010 5:49:08 PM
   
RE:Correctness error in protected code

Adam

Apologies for the delay in responding but we are examining this problem and will revert as soon as possible.

--John


User avatar
Member
Member
adam.azarchs - 8/20/2010 6:01:37 PM
   
RE:Correctness error in protected code

 I've worked around this problem in our code where I found it, so it's not extremely urgent.  I am more worried about the ramifications of this kind of silent failure for our QA process.


1

11 user(s) on-line: 0 registered and 11 guest(s)

  • Sticky
  • Locked sticky
  • Hot sticky
  • Hot locked sticky
  • Thread
  • Hot thread
  • Locked thread