MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxRemapCode

Function fxRemapCode

xs/tools/xslBase.c:678–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676}
677
678void fxRemapCode(txLinker* linker, txLinkerScript* script)
679{
680 register const txS1* sizes = gxCodeSizes;
681 register txByte* p = script->codeBuffer;
682 register txByte* q = p + script->codeSize;
683 register txByte* r = (txByte*)linker->map;
684 register txS1 offset;
685 txU1 code;
686 txU2 index;
687 txID id;
688 while (p < q) {
689 code = *((txU1*)p);
690 offset = (txS1)sizes[code];
691 if (0 < offset) {
692 p += offset;
693 }
694 else if (0 == offset) {
695 p++;
696 mxDecodeID(p, id);
697 mxEncodeID(r, id);
698 p -= sizeof(txID);
699 id = XS_NO_ID;
700 mxEncodeID(p, id);
701 }
702 else if (-1 == offset) {
703 p++;
704 index = *((txU1*)p);
705 p += 1 + index;
706 }
707 else if (-2 == offset) {
708 p++;
709 mxDecode2(p, index);
710 p += index;
711 }
712 else if (-4 == offset) {
713 p++;
714 mxDecode4(p, index);
715 p += index;
716 }
717 }
718 linker->map = (txID*)r;
719}
720
721void fxReportLinkerError(txLinker* linker, txString theFormat, ...)
722{

Callers 1

fxBufferMapsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected