We'll probably need something like this for d3dbc sources as well, since those generally aren't terminated by a "ret" instruction either, so in that sense this seems fine. I'm tempted to suggest handling this by appending a "ret" instruction to the vkd3d_shader_instruction_array if it doesn't already end with one, but I'd like to hear what Zeb and Conor think in any case.
I suppose the usual argument for preprocessing is that it'll help GLSL, but in this case GLSL doesn't actually need the ret, so it doesn't matter. I guess ultimately it doesn't seem to me like it matters enough to bikeshed anyway.
FWIW, sm1 will need something like this, but that doesn't really affect anything.