When a WriteItem is called with an EXTERNALSXP that is not Code, Function or DispatchTable, it ends up in an endless loop.
WriteItem calls to an externalCodeWrite function pointer, which is set to serializeRir. Then it calls WriteItem with the result of rirDecompile.
Currently, the rirDecompile function only deserializes Code, Function and DispatchTable types. For all others it returns the SEXP unmodified.
Hence the second call to WriteItem is the same as the first one and it loops endlesly.
When a
WriteItemis called with an EXTERNALSXP that is notCode,FunctionorDispatchTable, it ends up in an endless loop.WriteItemcalls to anexternalCodeWritefunction pointer, which is set toserializeRir. Then it callsWriteItemwith the result ofrirDecompile.Currently, the
rirDecompilefunction only deserializesCode,FunctionandDispatchTabletypes. For all others it returns the SEXP unmodified.Hence the second call to
WriteItemis the same as the first one and it loops endlesly.