V9015

Code

V9015

Message

String header or constant pool entry has an invalid char_width byte

The VM read a char_width byte (the per-code-unit encoding tag of a string value) whose value was neither 1 (STRING / Latin-1) nor 2 (WSTRING / UTF-16LE).

char_width is carried in three places at runtime:

  1. each string variable’s data-region header

  2. each constant-pool string entry

  3. each temp-buffer slot

A valid .iplc file always carries a recognized encoding at every one of these sites. This trap fires when a byte read from any of them — or from the char_width operand of STR_INIT in the bytecode stream — holds an unrecognized value.

The analyzer and the constant-pool deserializer reject unknown encodings statically, so this trap is reached only via:

  1. A compiler bug that writes a malformed char_width byte into a string header, constant-pool entry, or bytecode operand.

  2. A tampered or hand-crafted ``.iplc`` file that holds an unrecognized encoding tag.

This error should not occur during normal operation. It indicates a bug in the IronPLC compiler or VM, or a corrupted .iplc file.

Report this as a bug at https://github.com/ironplc/ironplc/issues with the .iplc file and the source program that produced it.

Think IronPLC is wrong about this?

If you believe this diagnostic is incorrect, open an issue on GitHub with a small sample that demonstrates the problem.