Branch: Tag:

2014-02-05

2014-02-05 21:03:06 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Fix scope name for inherit ::this_program.

The scope name for inherits using ::this_program used to
be "this_program", which caused the "this_program::"-scope
to refer to the inherit rather than to the current class.

The scope now instead gets its name from the name of the current class.

Also fixes Crypto.CTR.State, which triggered the problem.

5001:    }    p = state->new_program;    numid = n->u.integer.b; +  if ((name == this_program_string) && (offset == 1)) { +  /* Klugde: Default to renaming ::this_program +  * to the name of the current class. +  * +  * Otherwise the this_program:-scope +  * will become confusing, as it will +  * refer to the inherit and not the +  * current class. +  */ +  name = ID_FROM_INT(p, numid)->name;    } -  +  }       continue_inherit: