Microsoft KB Archive/33600

Pascal Version 4.00 lstring Patch in Softlib PSS ID Number: Q33600 Article last modified on 05-06-1991 PSS database name: S_PasCal

4.00 | 4.00

MS-DOS | OS/2

Summary:

Pascal version 4.00 may incorrectly handle the assignment of lstrings, especially if they have been allocated on the long (or far) heap. The primary symptom is that the target lstring being assigned the lstring on the long heap will be null or destroyed as shown by CodeView or a write statement.

Microsoft has confirmed this to be a problem in Microsoft Pascal Compiler version 4.00 for MS-DOS and MS OS/2.

We have provided a README.DOC and necessary files in the archive file LSTRING4 to correct this problem. This file can be found in the Software Library by searching for LSTRING4, the Q number of this article, or S12019. LSTRING4 was archived using the PKware file-compression utility.

You may also request this correction as the application note “Pascal 4.00 Lstring Patch” on disk from Microsoft Product Support Services.

More Information:

The files contained in the Software Library file LSTRING4 are as follows:

pas2.exe partial.lib paslibw.lib misg6.obj readme.doc

The README.DOC file provides Pascal version 4.00 lstring assignment patch instructions:

README.DOC
The files on this disk are for correcting a problem with assigning lstrings allocated on the long heap in Pascal version 4.00. Both PAS2 of the compiler and two component libraries are affected, and should be replaced as indicated below with the files on this disk:

Disk Contents Description ————- ———–

pas2.exe New second pass of the compiler paslibw.lib New component library for Library 1 disk partial.lib New component library for Library 2 disk misg6.obj New internal library module to replace the old module in original partial.lib and paslibw.lIb readme.doc This file

The following are installation instructions:


 * 1) Copy your original Pascal version 4.00 floppy disks onto appropriately labeled backup disks. Use only the backup disks for the following steps.
 * 2) Copy pas2.exe from this disk to the Utilities disk. If you have already installed Pascal version 4.00, also copy the pas2.exe file on this disk to the directory that contains the old pas2.exe.
 * 3) Copy paslibw.lib from this disk to the Libraries 1 disk.
 * 4) Copy partial.lib from this disk to the Libraries 2 disk. (There only is one Libraries disk for 3.4-inch disks.)
 * 5) If you have not installed Pascal version 4.00 yet, do so now by placing the SETUP disk in Drive A and running “A:SETUP”.

If you already have installed Pascal version 4.00, run Setup with the /L option to replace all the combined libraries that you created during the initial setup. If you created several libraries with different math options, you will need to run Setup /L for each math option. You may use makelib.bat from the Libraries 1 disk if you prefer.

The library module misg6.obj is included for those who are familiar with the LIB utility version 3.11. With LIB you can replace this module directly in existing combined libraries to correct the libraries. LIB must be in your path, and misg6.obj should be copied to your library directory. For example, to correct libpase.lib, enter the following at the command prompt:

lib libpase.lib-+misg6.obj,,libpase.lib

Substituting the name of other libraries for “libpase.lib” in the above command allows you to correct them as well. If you encounter any problems with this approach, please use the full installation instructions.

Copyright Microsoft Corporation 1991.