View Issue Details

IDProjectCategoryView StatusLast Update
0001087Ecere SDKecerepublic2018-08-19 17:08
Reporterjerome Assigned Tojerome  
PriorityimmediateSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version0.44.09 
Target Version0.44.10 64Fixed in Version0.44.10 64 
Summary0001087: Various class:struct classes issues
Description- Watches on a derived class:struct member whose base class has end-padding did not work
- Alignment issues as derived classes are bundled together in a single struct
- Derived class offset was not correct
- OnGetString, OnGetDataFromString and JSON did not add class offset but should have
- typed_object& methods when called as a member of a class:struct did not have proper reference level (the address of the class:struct instance should be passed)
Steps To Reproduceimport "ecere"

ConsoleFile con { };

class BaseStruct : struct
{
public:
   void * type;
   int continued;
};

static class DerivedStruct : BaseStruct
{
public:
   int y, x;
};

class Form1 : Window
{
   caption = $"Form1";
   background = formColor;
   borderStyle = sizable;
   hasMaximize = true;
   hasMinimize = true;
   hasClose = true;
   clientSize = { 632, 438 };

   Button button1
   {
      this, caption = $"button1", position = { 296, 120 };

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         DerivedStruct foo { y = 4, x = 5 };
         char temp[100];
         PrintLn(foo);

         foo.OnGetString(temp, null, null);
         PrintLn(temp);

         delete foo;
         foo.OnGetDataFromString(temp);

         WriteJSONObject(con, class(DerivedStruct), foo, 0);
         return true;
      }
   };
}

Form1 form1 { };

----------------
Debugger test: Watch on foo.x should say 5
TagsNo tags attached.

Activities

jerome

2014-07-11 01:55

administrator   ~0001369

Fixed by:
https://github.com/ecere/ecere-sdk/commit/abfa4379c019b2bebc30a54331f0077bbe458208

jerome

2018-08-19 17:08

administrator   ~0001483

Review in light of commit
https://github.com/ecere/ecere-sdk/commit/62dd46bdb3860ba4ff7e927ad55bc0ab5877a723 which partially reverts the commit that fixed this.

Issue History

Date Modified Username Field Change
2014-07-11 01:35 jerome New Issue
2014-07-11 01:35 jerome Status new => assigned
2014-07-11 01:35 jerome Assigned To => jerome
2014-07-11 01:55 jerome Note Added: 0001369
2014-07-11 01:55 jerome Status assigned => resolved
2014-07-11 01:55 jerome Fixed in Version => 0.44.10 64
2014-07-11 01:55 jerome Resolution open => fixed
2014-08-08 18:17 jerome Status resolved => closed
2018-08-19 17:08 jerome Note Added: 0001483
2018-08-19 17:08 jerome Status closed => resolved