Compare commits

...

11 Commits

Author SHA1 Message Date
Bram Moolenaar
d041f4208b patch 8.2.4072: Vim9: compiling function fails when autoload is not loaded
Problem:    Vim9: compiling function fails when autoload script is not loaded
            yet.
Solution:   Depend on runtime loading.
2022-01-12 19:54:00 +00:00
Bram Moolenaar
53c296112e patch 8.2.4071: Vim9: no detection of return in try/endtry
Problem:    Vim9: no detection of return in try/endtry. (Dominique Pellé)
Solution:   Check if any of the blocks inside try/endtry did not end in
            return.
2022-01-12 16:18:18 +00:00
Dominique Pelle
f5d639a8af patch 8.2.4070: using uninitialized memory when reading empty file
Problem:    Using uninitialized memory when reading empty file.
Solution:   Check for empty file before checking for NL. (Dominique Pellé,
            closes #9511)
2022-01-12 15:24:40 +00:00
Bram Moolenaar
5d9826973d patch 8.2.4069: Vim9: import test fails on MS-Windows
Problem:    Vim9: import test fails on MS-Windows.
Solution:   Ignore case.  Adjust test to avoid name that only differs in case.
2022-01-12 15:15:27 +00:00
Bram Moolenaar
f479cac084 patch 8.2.4068: Vim9: import test fails
Problem:    Vim9: import test fails.
Solution:   Add missing change.
2022-01-12 12:54:55 +00:00
Bram Moolenaar
f111cdfae6 patch 8.2.4067: Vim9: cannot call imported function with :call
Problem:    Vim9: cannot call imported function with :call. (Drew Vogel)
Solution:   Translate the function name. (closes #9510)
2022-01-12 12:48:17 +00:00
Bram Moolenaar
17d36cbcd3 patch 8.2.4066: Vim9: imported autoload script loaded again
Problem:    Vim9: imported autoload script loaded again.
Solution:   Do not create a new imported_T every time.
2022-01-12 11:46:40 +00:00
Bram Moolenaar
3cf21b3051 patch 8.2.4065: computation overflow with large cound for :yank
Problem:    Computation overflow with large cound for :yank.
Solution:   Avoid an overflow.
2022-01-11 19:34:16 +00:00
Elwardi
2284f6cca3 patch 8.2.4064: foam files are not detected
Problem:    Foam files are not detected.
Solution:   Detect the foam filetype by the path and file contents. (Mohammed
            Elwardi Fadeli, closes #9501)
2022-01-11 18:14:23 +00:00
Bram Moolenaar
b8822442d7 patch 8.2.4063: Vim9: exported function in autoload script not found
Problem:    Vim9: exported function in autoload script not found. (Yegappan
            Lakshmanan)
Solution:   Use the autoload prefix to search for the function.
2022-01-11 15:24:05 +00:00
Bram Moolenaar
0bbca540f7 patch 8.2.4062: match highlighting of tab too short
Problem:    Match highlighting of tab too short.
Solution:   Do not stop match highlighting if on a Tab. (Christian Brabandt,
            closes #9507, closes #9500)
2022-01-11 13:14:54 +00:00
23 changed files with 431 additions and 35 deletions

View File

@@ -829,6 +829,23 @@ func dist#ft#Dep3patch()
endfor
endfunc
" This function checks the first 15 lines for appearance of 'FoamFile'
" and then 'object' in a following line.
" In that case, it's probably an OpenFOAM file
func dist#ft#FTfoam()
let ffile = 0
let lnum = 1
while lnum <= 15
if getline(lnum) =~# '^FoamFile'
let ffile = 1
elseif ffile == 1 && getline(lnum) =~# '^\s*object'
setf foam
return
endif
let lnum = lnum + 1
endwhile
endfunc
" Restore 'cpoptions'
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1214,6 +1214,9 @@ au BufNewFile,BufRead *.xom,*.xin setf omnimark
" OPAM
au BufNewFile,BufRead opam,*.opam,*.opam.template setf opam
" OpenFOAM
au BufNewFile,BufRead [a-zA-Z0-9]*Dict\(.*\)\=,[a-zA-Z]*Properties\(.*\)\=,*Transport\(.*\),fvSchemes,fvSolution,fvConstrains,fvModels,*/constant/g,*/0\(\.orig\)\=/* call dist#ft#FTfoam()
" OpenROAD
au BufNewFile,BufRead *.or setf openroad

View File

@@ -2043,9 +2043,10 @@ win_line(
if (n_extra < 0)
n_extra = 0;
}
if (on_last_col)
if (on_last_col && c != TAB)
// Do not continue search/match highlighting over the
// line break.
// line break, but for TABs the highlighting should
// include the complete width of the character
search_attr = 0;
if (c == TAB && n_extra + col > wp->w_width)

View File

@@ -906,7 +906,7 @@ get_lval(
NULL, TRUE) == -1)
{
*p = cc;
return FAIL;
return NULL;
}
*p = cc;
}
@@ -5903,7 +5903,7 @@ handle_subscript(
type_T *type;
// Found script from "import {name} as name", script item name must
// follow.
// follow. "rettv->vval.v_number" has the script ID.
if (**arg != '.')
{
if (verbose)

View File

@@ -2374,7 +2374,10 @@ do_one_cmd(
else
{
ea.line1 = ea.line2;
ea.line2 += n - 1;
if (ea.line2 >= LONG_MAX - (n - 1))
ea.line2 = LONG_MAX; // avoid overflow
else
ea.line2 += n - 1;
++ea.addr_count;
/*
* Be vi compatible: no error message for out of range.

View File

@@ -1796,7 +1796,7 @@ read_file_or_blob(typval_T *argvars, typval_T *rettv, int always_blob)
p < buf + readlen || (readlen <= 0 && (prevlen > 0 || binary));
++p)
{
if (*p == '\n' || readlen <= 0)
if (readlen <= 0 || *p == '\n')
{
listitem_T *li;
char_u *s = NULL;

View File

@@ -1274,7 +1274,8 @@ do_source(
// See if we loaded this script before.
sid = find_script_by_name(fname_exp);
if (sid > 0 && ret_sid != NULL)
if (sid > 0 && ret_sid != NULL
&& SCRIPT_ITEM(sid)->sn_state != SN_STATE_NOT_LOADED)
{
// Already loaded and no need to load again, return here.
*ret_sid = sid;
@@ -2155,7 +2156,7 @@ get_autoload_prefix(scriptitem_T *si)
if (p == NULL)
return NULL;
prefix = vim_strsave(p);
prefix = strlow_save(p);
if (prefix == NULL)
return NULL;

View File

@@ -0,0 +1,10 @@
| +0#ffffff16#e000002@6> |i+0#0000000#ffffff0|x| @64
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|,|1|-|8| @8|A|l@1|

View File

@@ -93,6 +93,13 @@ func Test_readfile_binary()
call delete('XReadfile_bin')
endfunc
func Test_readfile_binary_empty()
call writefile([], 'Xempty-file')
" This used to compare uninitialized memory in Vim <= 8.2.4065
call assert_equal([''], readfile('Xempty-file', 'b'))
call delete('Xempty-file')
endfunc
func Test_readfile_bom()
call writefile(["\ufeffFOO", "FOO\ufeffBAR"], 'XReadfile_bom')
call assert_equal(['FOO', 'FOOBAR'], readfile('XReadfile_bom'))

View File

@@ -704,9 +704,14 @@ func Test_address_line_overflow()
throw 'Skipped: only works with 64 bit long ints'
endif
new
call setline(1, 'text')
call setline(1, range(100))
call assert_fails('|.44444444444444444444444', 'E1247:')
call assert_fails('|.9223372036854775806', 'E1247:')
$
yank 77777777777777777777
call assert_equal("99\n", @")
bwipe!
endfunc

View File

@@ -1121,4 +1121,54 @@ func Test_git_file()
filetype off
endfunc
func Test_foam_file()
filetype on
call assert_true(mkdir('0', 'p'))
call assert_true(mkdir('0.orig', 'p'))
call writefile(['FoamFile {', ' object something;'], 'Xfile1Dict')
split Xfile1Dict
call assert_equal('foam', &filetype)
bwipe!
call writefile(['FoamFile {', ' object something;'], 'Xfile1Dict.something')
split Xfile1Dict.something
call assert_equal('foam', &filetype)
bwipe!
call writefile(['FoamFile {', ' object something;'], 'XfileProperties')
split XfileProperties
call assert_equal('foam', &filetype)
bwipe!
call writefile(['FoamFile {', ' object something;'], 'XfileProperties.something')
split XfileProperties.something
call assert_equal('foam', &filetype)
bwipe!
call writefile(['FoamFile {', ' object something;'], 'XfileProperties')
split XfileProperties
call assert_equal('foam', &filetype)
bwipe!
call writefile(['FoamFile {', ' object something;'], 'XfileProperties.something')
split XfileProperties.something
call assert_equal('foam', &filetype)
bwipe!
call writefile(['FoamFile {', ' object something;'], '0/Xfile')
split 0/Xfile
call assert_equal('foam', &filetype)
bwipe!
call writefile(['FoamFile {', ' object something;'], '0.orig/Xfile')
split 0.orig/Xfile
call assert_equal('foam', &filetype)
bwipe!
call delete('0', 'rf')
call delete('0.orig', 'rf')
filetype off
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -407,4 +407,22 @@ func Test_matchdelete_redraw()
bw!
endfunc
func Test_match_tab_with_linebreak()
CheckRunVimInTerminal
let lines =<< trim END
set linebreak
call setline(1, "\tix")
call matchadd('ErrorMsg', '\t')
END
call writefile(lines, 'XscriptMatchTabLinebreak')
let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10})
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {})
call StopVimInTerminal(buf)
call delete('XscriptMatchTabLinebreak')
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -1140,14 +1140,14 @@ def Test_vim9script_autoload()
# when using "vim9script autoload" prefix is not needed
var lines =<< trim END
vim9script autoload
g:prefixed_loaded = 'yes'
g:prefixed_loaded += 1
export def Gettest(): string
return 'test'
enddef
export func GetSome()
return 'some'
export func GetMore()
return Gettest() .. 'more'
endfunc
export var name = 'name'
@@ -1156,30 +1156,100 @@ def Test_vim9script_autoload()
END
writefile(lines, 'Xdir/autoload/prefixed.vim')
g:prefixed_loaded = 0
g:expected_loaded = 0
lines =<< trim END
vim9script
import autoload 'prefixed.vim'
assert_false(exists('g:prefixed_loaded'))
assert_equal(g:expected_loaded, g:prefixed_loaded)
assert_equal('test', prefixed.Gettest())
assert_equal('yes', g:prefixed_loaded)
assert_equal(1, g:prefixed_loaded)
assert_equal('some', prefixed.GetSome())
assert_equal('testmore', prefixed.GetMore())
assert_equal('name', prefixed.name)
assert_equal('final', prefixed.fname)
assert_equal('const', prefixed.cname)
END
CheckScriptSuccess(lines)
# can source it again, autoload script not loaded again
g:expected_loaded = 1
CheckScriptSuccess(lines)
# can also get the items by autoload name
lines =<< trim END
call assert_equal('test', prefixed#Gettest())
call assert_equal('some', prefixed#GetSome())
call assert_equal('testmore', prefixed#GetMore())
call assert_equal('name', prefixed#name)
call assert_equal('final', prefixed#fname)
call assert_equal('const', prefixed#cname)
END
CheckScriptSuccess(lines)
unlet g:prefixed_loaded
unlet g:expected_loaded
delete('Xdir', 'rf')
&rtp = save_rtp
enddef
def Test_vim9script_autoload_call()
mkdir('Xdir/autoload', 'p')
var save_rtp = &rtp
exe 'set rtp^=' .. getcwd() .. '/Xdir'
var lines =<< trim END
vim9script autoload
export def Getother()
g:result = 'other'
enddef
END
writefile(lines, 'Xdir/autoload/another.vim')
lines =<< trim END
vim9script
import autoload 'another.vim'
call another.Getother()
assert_equal('other', g:result)
END
CheckScriptSuccess(lines)
unlet g:result
delete('Xdir', 'rf')
&rtp = save_rtp
enddef
def Test_import_autoload_postponed()
mkdir('Xdir/autoload', 'p')
var save_rtp = &rtp
exe 'set rtp^=' .. getcwd() .. '/Xdir'
var lines =<< trim END
vim9script autoload
g:loaded_postponed = 'true'
export var variable = 'bla'
export def Function(): string
return 'bla'
enddef
END
writefile(lines, 'Xdir/autoload/postponed.vim')
lines =<< trim END
vim9script
import autoload 'postponed.vim'
def Tryit()
echo postponed.variable
echo postponed.Function()
enddef
defcompile
END
CheckScriptSuccess(lines)
assert_false(exists('g:loaded_postponed'))
CheckScriptSuccess(lines + ['Tryit()'])
assert_equal('true', g:loaded_postponed)
unlet g:loaded_postponed
delete('Xdir', 'rf')
&rtp = save_rtp
enddef

View File

@@ -667,7 +667,6 @@ def Test_try_catch_throw()
finally
return 6
endtry
return -1
enddef
assert_equal(6, ReturnInFinally())
@@ -708,6 +707,64 @@ def Test_try_catch_throw()
CheckDefAndScriptSuccess(lines)
enddef
def Test_try_ends_in_return()
var lines =<< trim END
vim9script
def Foo(): string
try
return 'foo'
catch
return 'caught'
endtry
enddef
assert_equal('foo', Foo())
END
CheckScriptSuccess(lines)
lines =<< trim END
vim9script
def Foo(): string
try
return 'foo'
catch
return 'caught'
endtry
echo 'notreached'
enddef
assert_equal('foo', Foo())
END
CheckScriptFailure(lines, 'E1095:')
lines =<< trim END
vim9script
def Foo(): string
try
return 'foo'
catch /x/
return 'caught'
endtry
enddef
assert_equal('foo', Foo())
END
CheckScriptFailure(lines, 'E1027:')
lines =<< trim END
vim9script
def Foo(): string
try
echo 'foo'
catch
echo 'caught'
finally
return 'done'
endtry
enddef
assert_equal('done', Foo())
END
CheckScriptSuccess(lines)
enddef
def Test_try_in_catch()
var lines =<< trim END
vim9script

View File

@@ -1871,9 +1871,13 @@ fname_trans_sid(char_u *name, char_u *fname_buf, char_u **tofree, int *error)
static ufunc_T *
find_func_with_sid(char_u *name, int sid)
{
hashitem_T *hi;
char_u buffer[200];
hashitem_T *hi;
char_u buffer[200];
if (!SCRIPT_ID_VALID(sid))
return NULL; // not in a script
// A script-local function is stored as "<SNR>99_name".
buffer[0] = K_SPECIAL;
buffer[1] = KS_EXTRA;
buffer[2] = (int)KE_SNR;
@@ -1882,6 +1886,46 @@ find_func_with_sid(char_u *name, int sid)
hi = hash_find(&func_hashtab, buffer);
if (!HASHITEM_EMPTY(hi))
return HI2UF(hi);
return NULL;
}
/*
* Find a function "name" in script "sid" prefixing the autoload prefix.
*/
static ufunc_T *
find_func_with_prefix(char_u *name, int sid)
{
hashitem_T *hi;
char_u buffer[200];
scriptitem_T *si;
if (vim_strchr(name, AUTOLOAD_CHAR) != 0)
return NULL; // already has the prefix
if (!SCRIPT_ID_VALID(sid))
return NULL; // not in a script
si = SCRIPT_ITEM(sid);
if (si->sn_autoload_prefix != NULL)
{
size_t len = STRLEN(si->sn_autoload_prefix) + STRLEN(name) + 1;
char_u *auto_name;
// An exported function in an autoload script is stored as
// "dir#path#name".
if (len < sizeof(buffer))
auto_name = buffer;
else
auto_name = alloc(len);
if (auto_name != NULL)
{
vim_snprintf((char *)auto_name, len, "%s%s",
si->sn_autoload_prefix, name);
hi = hash_find(&func_hashtab, auto_name);
if (auto_name != buffer)
vim_free(auto_name);
if (!HASHITEM_EMPTY(hi))
return HI2UF(hi);
}
}
return NULL;
}
@@ -1917,7 +1961,9 @@ find_func_even_dead(char_u *name, int is_global, cctx_T *cctx UNUSED)
if (!HASHITEM_EMPTY(hi))
return HI2UF(hi);
return NULL;
// Find autoload function if this is an autoload script.
return find_func_with_prefix(name[0] == 's' && name[1] == ':'
? name + 2 : name, current_sctx.sc_sid);
}
/*
@@ -3698,6 +3744,30 @@ trans_function_name(
if (name == lv.ll_exp_name)
name = NULL;
}
else if (lv.ll_sid > 0)
{
scriptitem_T *si = SCRIPT_ITEM(lv.ll_sid);
int cc = *lv.ll_name_end;
// function in another script. Prefix <SNR>99_ or the autoload prefix.
*lv.ll_name_end = NUL;
if (si->sn_autoload_prefix != NULL)
{
name = concat_str(si->sn_autoload_prefix, lv.ll_name);
}
else
{
sid_buf[0] = K_SPECIAL;
sid_buf[1] = KS_EXTRA;
sid_buf[2] = (int)KE_SNR;
vim_snprintf((char *)sid_buf + 3, sizeof(sid_buf) - 3,
"%ld_", (long)current_sctx.sc_sid);
name = concat_str(sid_buf, lv.ll_name);
}
*lv.ll_name_end = cc;
*pp = end;
goto theend;
}
else if (!(flags & TFN_NO_DEREF))
{
len = (int)(end - *pp);

View File

@@ -750,6 +750,28 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4072,
/**/
4071,
/**/
4070,
/**/
4069,
/**/
4068,
/**/
4067,
/**/
4066,
/**/
4065,
/**/
4064,
/**/
4063,
/**/
4062,
/**/
4061,
/**/

View File

@@ -594,6 +594,8 @@ typedef struct {
endlabel_T *ts_end_label; // jump to :finally or :endtry
int ts_catch_label; // instruction idx of last CATCH
int ts_caught_all; // "catch" without argument encountered
int ts_has_finally; // "finally" encountered
int ts_no_return; // one of the blocks did not end in return
} tryscope_T;
typedef enum {

View File

@@ -1343,6 +1343,8 @@ compile_catch(char_u *arg, cctx_T *cctx UNUSED)
emsg(_(e_catch_unreachable_after_catch_all));
return NULL;
}
if (!cctx->ctx_had_return)
scope->se_u.se_try.ts_no_return = TRUE;
if (cctx->ctx_skip != SKIP_YES)
{
@@ -1498,6 +1500,7 @@ compile_finally(char_u *arg, cctx_T *cctx)
isn->isn_arg.jump.jump_where = this_instr;
scope->se_u.se_try.ts_catch_label = 0;
}
scope->se_u.se_try.ts_has_finally = TRUE;
if (generate_instr(cctx, ISN_FINALLY) == NULL)
return NULL;
}
@@ -1567,6 +1570,14 @@ compile_endtry(char_u *arg, cctx_T *cctx)
}
}
// If there is a finally clause that ends in return then we will return.
// If one of the blocks didn't end in "return" or we did not catch all
// exceptions reset the had_return flag.
if (!(scope->se_u.se_try.ts_has_finally && cctx->ctx_had_return)
&& (scope->se_u.se_try.ts_no_return
|| !scope->se_u.se_try.ts_caught_all))
cctx->ctx_had_return = FALSE;
compile_endblock(cctx);
if (cctx->ctx_skip != SKIP_YES)

View File

@@ -623,10 +623,12 @@ find_imported(char_u *name, size_t len, int load, cctx_T *cctx)
if (ret != NULL && load && ret->imp_flags == IMP_FLAGS_AUTOLOAD)
{
scid_T dummy;
// script found before but not loaded yet
ret->imp_flags = 0;
(void)do_source(SCRIPT_ITEM(ret->imp_sid)->sn_name, FALSE,
DOSO_NONE, NULL);
DOSO_NONE, &dummy);
}
return ret;
}
@@ -3039,7 +3041,6 @@ compile_def_function(
break;
case CMD_endtry:
line = compile_endtry(p, &cctx);
cctx.ctx_had_return = FALSE;
break;
case CMD_throw:
line = compile_throw(p, &cctx);

View File

@@ -2227,6 +2227,16 @@ exec_instructions(ectx_T *ectx)
}
di = find_var_in_ht(ht, 0, iptr->isn_arg.string, TRUE);
if (di == NULL && ht == get_globvar_ht())
{
// may need to load autoload script
if (script_autoload(iptr->isn_arg.string, FALSE))
di = find_var_in_ht(ht, 0,
iptr->isn_arg.string, TRUE);
if (did_emsg)
goto on_error;
}
if (di == NULL)
{
SOURCING_LNUM = iptr->isn_lnum;

View File

@@ -274,6 +274,8 @@ compile_load_scriptvar(
int cc;
ufunc_T *ufunc;
type_T *type;
int done = FALSE;
int res = OK;
// TODO: if this is an autoload import do something else.
// Need to lookup the member.
@@ -296,11 +298,31 @@ compile_load_scriptvar(
cc = *p;
*p = NUL;
idx = find_exported(import->imp_sid, exp_name, &ufunc, &type,
si = SCRIPT_ITEM(import->imp_sid);
if (si->sn_autoload_prefix != NULL
&& si->sn_state == SN_STATE_NOT_LOADED)
{
char_u *auto_name = concat_str(si->sn_autoload_prefix, exp_name);
// autoload script must be loaded later, access by the autoload
// name.
if (cc == '(')
res = generate_PUSHFUNC(cctx, auto_name, &t_func_any);
else
res = generate_LOAD(cctx, ISN_LOADG, 0, auto_name, &t_any);
vim_free(auto_name);
done = TRUE;
}
else
{
idx = find_exported(import->imp_sid, exp_name, &ufunc, &type,
cctx, TRUE);
}
*p = cc;
p = skipwhite(p);
*end = p;
if (done)
return res;
if (idx < 0)
{

View File

@@ -714,7 +714,6 @@ generate_PUSHBLOB(cctx_T *cctx, blob_T *blob)
/*
* Generate an ISN_PUSHFUNC instruction with name "name".
* Consumes "name".
*/
int
generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type)
@@ -727,7 +726,8 @@ generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type)
return FAIL;
if (name == NULL)
funcname = NULL;
else if (*name == K_SPECIAL) // script-local
else if (*name == K_SPECIAL // script-local
|| vim_strchr(name, AUTOLOAD_CHAR) != NULL) // autoload
funcname = vim_strsave(name);
else
{

View File

@@ -250,6 +250,8 @@ ex_incdec(exarg_T *eap)
void
ex_export(exarg_T *eap)
{
int prev_did_emsg = did_emsg;
if (!in_vim9script())
{
emsg(_(e_export_can_only_be_used_in_vim9script));
@@ -273,12 +275,14 @@ ex_export(exarg_T *eap)
// The command will reset "is_export" when exporting an item.
if (is_export)
{
emsg(_(e_export_with_invalid_argument));
if (did_emsg == prev_did_emsg)
emsg(_(e_export_with_invalid_argument));
is_export = FALSE;
}
break;
default:
emsg(_(e_invalid_command_after_export));
if (did_emsg == prev_did_emsg)
emsg(_(e_invalid_command_after_export));
break;
}
}
@@ -484,7 +488,16 @@ handle_import(
// we need a scriptitem without loading the script
sid = find_script_in_rtp(from_name);
vim_free(from_name);
res = SCRIPT_ID_VALID(sid) ? OK : FAIL;
if (SCRIPT_ID_VALID(sid))
{
scriptitem_T *si = SCRIPT_ITEM(sid);
if (si->sn_autoload_prefix == NULL)
si->sn_autoload_prefix = get_autoload_prefix(si);
res = OK;
}
else
res = FAIL;
}
else
{
@@ -589,14 +602,17 @@ handle_import(
&& check_defined(as_name, STRLEN(as_name), cctx, FALSE) == FAIL)
goto erret;
imported = new_imported(import_gap);
if (imported == NULL)
goto erret;
imported->imp_name = as_name;
as_name = NULL;
imported->imp_sid = sid;
if (is_autoload)
imported->imp_flags = IMP_FLAGS_AUTOLOAD;
{
imported = new_imported(import_gap);
if (imported == NULL)
goto erret;
imported->imp_name = as_name;
as_name = NULL;
imported->imp_sid = sid;
if (is_autoload)
imported->imp_flags = IMP_FLAGS_AUTOLOAD;
}
}
erret: