[Gambas-bugtracker] Bug #1715: Have varptr() return the pointer to the data of a variant, instead of constanly coping the data to a fixed datatype

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sat Jan 18 06:36:28 CET 2020


http://gambaswiki.org/bugtracker/edit?object=BUG.1715&from=L21haW4-

Comment #3 by Brian G:

Hi It seem that the changed make System crash with 


gb.jit: panic: unsupported VarPtr()


//////// Main

void jit_main_2(uchar n);
static void jit_main_2_();

// Main

void jit_main_2(uchar n)
{
  jit_main_2_();
}

static void jit_main_2_()
{
  const GB_VARIANT null_variant = {GB_T_VARIANT,{GB_T_NULL}};
  GB_VARIANT l0 = null_variant;
  intptr_t l1 = 0;
  VALUE **psp = (VALUE **)0x5611e27f9768;
  VALUE *sp = SP;
  ushort *pc = (ushort *)0x5611e2d8235c;
  GB_VALUE_GOSUB *gp = 0;
  bool error = FALSE;
  GB_VARIANT rv;
  VALUE *ssp = sp;
  TRY {

__L0:; // Main.Main.8
  rv = (l0);
  l0 = BORROW_v(CONV(CONSTANT_s(0x5611e2d8242d, 12), t, v, GB_T_VARIANT));
  GB.ReleaseValue((GB_VALUE *)&rv);
__L3:; // Main.Main.11


Using the following code:

' Gambas module file


Fast Unsafe

Public Sub Main()

  Dim i As Variant = "This is fast"
  Dim j As Pointer
  
  j = VarPtr(i)

  Print j, i

End




More information about the Bugtracker mailing list