Commit e966238c authored by Maxime Perrotin's avatar Maxime Perrotin

Allow encoding buffers to be of size 0

Some types do not need any space for encoding in uPER or ACN (e.g. an enumerated with a
single value), but there was a assert prevening that case, possibly causing
unwanted exceptions at runtime.
parent 327f5c86
......@@ -102,7 +102,7 @@ def OnStartup(unused_modelingLanguage: str, asnFile: str, outputDir: str, badTyp
g_outputGetSetC.write('}\n\n')
g_outputGetSetC.write('void ResetStream(BitStream *pStrm) {\n')
g_outputGetSetC.write(' assert(pStrm);\n')
g_outputGetSetC.write(' assert(pStrm->count > 0);\n')
g_outputGetSetC.write(' assert(pStrm->count >= 0);\n')
g_outputGetSetC.write(' pStrm->currentByte = 0;\n')
g_outputGetSetC.write(' pStrm->currentBit = 0;\n')
g_outputGetSetC.write('}\n\n')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment