hlorenzi / customasm

💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Apache License 2.0
720 stars 56 forks source link

"error: data element size did not converge after iterations" when outputting strings with a sized data directive #113

Closed jonicho closed 3 years ago

jonicho commented 3 years ago

When you try to output a string with a sized data directive the assembler outputs the error "error: data element size did not converge after iterations" instead of outputting the string or telling the user that the string is larger than the directive size. Examples: #d123 "Hello, world!" ; should output the string #d3 "test" ; should tell the user that the string is longer than 3 bits #d8 "ü" ; should tell the user that the string is longer than 8 bits

Interestingly, the error does not occur with the #d8 directive and a string with a length of one byte. The unsized data directive is unaffected. The bug seems to have been introduced in commit 4e1426c811c4609fda00dc1845f4bb50f9df1368

hlorenzi commented 3 years ago

Oh, no... I was in the middle of changing some implementation details regarding strings, and no errors had cropped up in the tests... Clearly for lack of relevant test cases.