Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
April 23, 2014 [Issue 12616] AssertError in std.utf.decode | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12616 Dmitry Tsvettsikh <dmitrycvet@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dmitrycvet@gmail.com -- |
April 23, 2014 [Issue 12616] AssertError in std.utf.decode | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12616 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich@gmail.com, | |monarchdodra@gmail.com --- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> --- Interesting problem. I think decode is wrong in using asserts here. asserts are for checking program state, enforce is for checking input. So I think the assert should be changed to: enforceEx!UTFException(isValidDchar(result)); Or something similar. monarchdodra what do you think? -- |
April 23, 2014 [Issue 12616] AssertError in std.utf.decode | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12616 --- Comment #2 from monarchdodra@gmail.com --- (In reply to Andrej Mitrovic from comment #1) > Interesting problem. I think decode is wrong in using asserts here. asserts are for checking program state, enforce is for checking input. So I think the assert should be changed to: > > enforceEx!UTFException(isValidDchar(result)); > > Or something similar. monarchdodra what do you think? I think decode is supposed to throw an exception when it does decode an invalid character (and usually does). The assert is thrown in a "out" contract. If it triggers, it means decode has failed to detect the bad character. The assert itself shouldn't actually be changed, it just means there's an internal bug. Now, we need to figure out which character is being thrown, and how it "passed through the decode net". Interesting problem. I'll investigate. -- |
April 23, 2014 [Issue 12616] AssertError in std.utf.decode | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12616 --- Comment #3 from monarchdodra@gmail.com --- (In reply to Andrej Mitrovic from comment #1) > Interesting problem. I think decode is wrong in using asserts here. asserts are for checking program state, enforce is for checking input. So I think the assert should be changed to: > > enforceEx!UTFException(isValidDchar(result)); > > Or something similar. monarchdodra what do you think? BTW: How did you tag me? Did you simply add my email to the cc list? -- |
April 23, 2014 [Issue 12616] AssertError in std.utf.decode | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12616 --- Comment #4 from monarchdodra@gmail.com --- BTW, this seems resolved in HEAD. Didn't Dmitry fix this? Let me look up the pull... -- |
April 23, 2014 [Issue 12616] AssertError in std.utf.decode | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12616 monarchdodra@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #5 from monarchdodra@gmail.com --- Ah! There we go! https://github.com/D-Programming-Language/phobos/pull/2038 Closing as resolved duplicate of resolved issue 12419. *** This issue has been marked as a duplicate of issue 12419 *** -- |
April 23, 2014 [Issue 12616] AssertError in std.utf.decode | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12616 --- Comment #6 from Andrej Mitrovic <andrej.mitrovich@gmail.com> --- (In reply to monarchdodra from comment #3) > BTW: How did you tag me? Did you simply add my email to the cc list? I searched for your e-mail on github and added you to the cc list. Hope you don't mind (I thought you'd know about this UTF stuff). -- |
Copyright © 1999-2021 by the D Language Foundation