When storing to local variable (eg. OpCopyLogical), the default device address space used during casts is illegal. Determine correct address space based on variable type.