Skip to content

Commit

Permalink
fix reg param error
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed May 10, 2012
1 parent a1b6584 commit 786382f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/cod1.c
Expand Up @@ -2348,7 +2348,7 @@ static int type_jparam2(type *t, tym_t ty)
int FuncParamRegs::alloc(type *t, tym_t ty, unsigned char *preg1, unsigned char *preg2)
{
// If struct just wraps another type
if (ty == TYstruct && tybasic(t->Tty) == TYstruct)
if (tybasic(ty) == TYstruct && tybasic(t->Tty) == TYstruct)
{
type *targ1 = t->Ttag->Sstruct->Sarg1type;
type *targ2 = t->Ttag->Sstruct->Sarg2type;
Expand Down
30 changes: 30 additions & 0 deletions test/runnable/sdtor.d
Expand Up @@ -2070,6 +2070,35 @@ struct S8036b // or class

/**********************************/

struct S61
{
this(long length)
{
this.length = length;
}

long length;
}


const(S61) copy(const S61 s)
{
return s;
}


void test61()
{
S61 t = S61(42);
const S61 u = t;

assert(t == u);
assert(copy(t) == u);
assert(t == copy(u));
}

/**********************************/

int main()
{
test1();
Expand Down Expand Up @@ -2142,6 +2171,7 @@ int main()
test6636();
test6637();
test7353();
test61();

printf("Success\n");
return 0;
Expand Down

0 comments on commit 786382f

Please sign in to comment.