mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
Merge pull request #3941 from oderwat/hara-php-mnewString-fix
Fix for PHP mnewString()
This commit is contained in:
@@ -263,9 +263,7 @@ proc toJSStr(s: string): cstring {.asmNoStackFrame, compilerproc.} =
|
||||
proc mnewString(len: int): string {.asmNoStackFrame, compilerproc.} =
|
||||
when defined(nimphp):
|
||||
asm """
|
||||
$result = array();
|
||||
for($i = 0; $i < `len`; $i++) $result[] = chr(0);
|
||||
return $result;
|
||||
return str_repeat(chr(0),`len`);
|
||||
"""
|
||||
else:
|
||||
asm """
|
||||
|
||||
Reference in New Issue
Block a user