Results 1 to 9 of 9

Thread: Dangerous code

  1. #1

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Angry Dangerous code

    My latest project crashes MSVC6 IDE, if i copy and paste the code into any other project in any instance of an ide it will instantly crash it after some keypresses or mouse clicks, without even showing up a error message or Send this error report to microsoft or anything.
    Anyone had similar problems?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  2. #2

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Smile IDE Killer located

    Took a while to track down what really caused the crash by copying in blocks of lines from notepad until it seemed to crash with the last line of the following:
    PHP Code:
    class v2x: public scal{public:inline v2x(int p):scal(p){};inline v2x(){};}v2x_;
    class 
    rectx1: public rectx1{public:inline v2x(int p):scal(p){};inline v2x(){};}rectx1_
    scal being:
    PHP Code:
    class scal{
    protected:
        
    int s;
    public:
        
    inline scal(){};
        
    inline scal(const int a):s(a){};
        
    inline operator int(){return s;};
    }; 
    The original scal is much larger but i cut it down. The code is of course faulty, you don't really inherit a class from itself, somehow both lines are needed and the constructor is also yet unrenamed, however renaming it will cause a delayed crash, so i let it be. Here's the correct version:
    PHP Code:
    class v2x: public scal{public:inline v2x(int p):scal(p){};inline v2x(){};}v2x_;
    class 
    rectx1: public scal{public:inline rectx1(int p):scal(p){};inline v2x(){};}rectx1_
    Have fun crashing msvc6 but save your project first
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Zaei
    Guest
    Heh, that makes sense... What is probably happening is that when you copy that class declaration in, it tries to populate the Class Browser's list, but since you are inheriting from itself, you are probably getting into a recursive loop, until you overflow the stack. Boom.

    Z.

  4. #4
    Zaei
    Guest
    Never mind.

    Z.

  5. #5
    Zaei
    Guest
    How to kill the IDE, by kedaman =).

    Z.

  6. #6
    Zaei
    Guest
    My copy wont crash unless/until the Class Browser updates. That is probably your problem.

    Z.

  7. #7

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Nope there's something more complex, both of the lines are needed for the crash to appear. Otherways i think even M$ would have eliminated that bug.

    Well now i'm the official IDE Killer Guru
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You evil bastard

    You can't crash my Editor 99! Hah!
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    not my notepad either
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width