Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Extract Method creates invalid code (&C::m)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

legalize
Tomato Guru

USA
119 Posts

Posted - Jun 16 2014 :  11:07:32 AM  Show Profile  Reply with Quote
See test suite at http://d3dgraphicspipeline.codeplex.com/releases/view/39824

typedef void (Bar::*MethodPtr)(int);
MethodPtr Method4(int x)
{
    MethodPtr member;
    if (x < 0)
    {
        // #TEST#: EM4 Extract Method on next line
        // #TEST#: EM20 Extract Method on rhs of assignment
        member = &Bar::Operation1;
    }
    else
    {
        member = &Bar::Operation2;
    }
    return member;
}

Extract Method EM20 produces:

typedef void (Bar::*MethodPtr)(int);
MethodPtr Method4(int x)
{
    MethodPtr member;
    if (x < 0)
    {
        // #TEST#: EM4 Extract Method on next line
        // #TEST#: EM20 Extract Method on rhs of assignment
        member = MyMethod();
    }
    else
    {
        member = &Bar::Operation2;
    }
    return member;
}

void MyMethod()
{
    return &Bar::Operation1;
}

http://legalizeadulthood.wordpress.com

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Jun 16 2014 :  5:09:55 PM  Show Profile  Reply with Quote
Unfortunately you have stripped out to much of the surrounding code, I am not seeing this problem with this code sample. Also you have posted a code sample with two different instructions, EM4 and EM20, and not indicated which one you are reporting a problem with. I am seeing the same problem with EM20 in the test project, so something else is involved in triggering this problem. Looking into this now.

Hopefully though you can see why working through your project is going to be a very slow process, since I need to actually identify the triggers for the bugs, whenever possible.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Jun 16 2014 :  6:32:09 PM  Show Profile  Reply with Quote
Got it, I have been able to reduce this down to a simple reliable test case:

case=83005

zen is the art of being at one with the two'ness
Go to Top of Page

legalize
Tomato Guru

USA
119 Posts

Posted - Jun 17 2014 :  11:30:54 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline
Hopefully though you can see why working through your project is going to be a very slow process, since I need to actually identify the triggers for the bugs, whenever possible.



It took me a couple hours to manually work my way through the test cases I reported in the summary post. Obviously you don't need to work through the ones that passed. Download the whole suite and work through the ones that fail -- the suite is the context for each reported problem. That's why I'm including the link to the suite in each related bug report.

http://legalizeadulthood.wordpress.com
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Jun 22 2014 :  10:27:36 PM  Show Profile  Reply with Quote
I realise this, but this has to fit in around all of my other work, and the complete project is a long way from a focussed and clear bug report for a single problem. So the bugs need to be isolated and pinned down, so we know what is actually going wrong. So this is going to take however long it takes.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000