www.digitalmars.com         C & C++   DMDScript  

D - bug report in D compiler ?

reply "Lloyd Dupont" <lloyd galador.net> writes:
I have a simple program with 2 files registry.d, regdump.d (see below) and
when I try
to compile it I always get thiw error message:
# ---------------------------
C:\D\dev\lloyd\reg>dmd -o a.exe regdump.d registry.d && a
Assertion failure: '0' on line 232 in file 'module.c'

abnormal program termination
# -------- registry.d --------
module lloyd.registry;

import windows;
import string;

extern (Windows)
{
 export LONG RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,PHKEY);
 export LONG RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
}
LONG RegOpenKeyEx(HKEY hKey, char[] lpSubKey, DWORD ulOptions, REGSAM
samDesired, PHKEY phkResult)
{
    return RegOpenKeyExA(hKey, lpSubKey, ulOptions, samDesired, phkResult);
}
# ------- regdump.d -------
import windows, registry;
import string;
import lloyd.registry;


char[] tostring(char* cstring)
{
    int n = strlen(cstring);
    return cstring[0 .. n];
}

void dump(HKEY root, char[] subkey)
{
 HKEY rKey;

 LONG ret = RegOpenKeyEx(
  root,
  subkey,
  0,
  KEY_READ,
  &rKey);
    assert(ret == ERROR_SUCCESS);

    try {
    }
    finally { RegCloseKey(rKey); }
}

// dmd -o a.exe regdump.d registry.d && a
int main(char[][] args)
{
    dump(HKEY_LOCAL_MACHINE, 'Software\7-ZIP');
    return 0;
}
# ---------------------------
Nov 09 2002
parent reply "Walter" <walter digitalmars.com> writes:
Got it, thanks. -Walter
Nov 12 2002
parent reply Lloyd Dupont <lloyd galador.net> writes:
Walter wrote:

 Got it, thanks. -Walter

cool......... !!! when would I be able to download the new compiler ? :-) ?
Nov 12 2002
parent "Walter" <walter digitalmars.com> writes:
"Lloyd Dupont" <lloyd galador.net> wrote in message
news:aqrtu1$12nm$2 digitaldaemon.com...
 Walter wrote:

 Got it, thanks. -Walter

cool......... !!! when would I be able to download the new compiler ? :-) ?

When I fix it !
Nov 13 2002