Not really a bug, more a beginners error
All conditional jump instructions are relative to their location.
Code:
0x000000 33 C0 xor eax, eax
0x000002 85 C0 test eax, eax
0x000004 74 FE jz 0x4
This code will loop forever. It will always jump 0xFE bytes far, which is -2 bytes in decimal. So the jz will always land on the jz instruction.
Lets come back to your code: You're instructing the compiler to calculate a JMP instruction from a variable. On pure semantic, this is a valid idea since all assemblers accept JX <absolute address> or <label> rather than <relative offset>. But this only works, if you know where in the code your JMP instruction will be placed AND where the JMPs target instruction will be placed. You'll need the relative offsets aka. the distance between these two locations.
Having the target location in a variable is simply not assembleable.