Title: Parsing an array with too many dimensions throws exception · Issue #16275 · PowerShell/PowerShell · GitHub
Open Graph Title: Parsing an array with too many dimensions throws exception · Issue #16275 · PowerShell/PowerShell
X Title: Parsing an array with too many dimensions throws exception · Issue #16275 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/16275
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Parsing an array with too many dimensions throws exception","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nThis was originally reported in https://github.com/PowerShell/PSReadLine/issues/2923 by @HumanEquivalentUnit \r\n\r\nRun the following script in pwsh:\r\n```powershell\r\n[System.Management.Automation.Language.Parser]::ParseInput('[int[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]', [ref]$null, [ref]$null)\r\n```\r\n\r\n### Expected behavior\r\n\r\n```console\r\nNo exception thrown from `Parser.ParseInput`\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\nPS:3> $a = [System.Management.Automation.Language.Parser]::ParseInput('[int[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]', [ref]$null, [ref]$null)\r\nMethodInvocationException: Exception calling \"ParseInput\" with \"3\" argument(s): \"Unrecoverable error in PowerShell.\"\r\n```\r\n\r\n\r\n### Error details\r\n\r\n```console\r\nPS:4> Get-Error\r\n\r\nException :\r\n Type : System.Management.Automation.MethodInvocationException\r\n ErrorRecord :\r\n Exception :\r\n Type : System.Management.Automation.ParentContainsErrorRecordException\r\n Message : Exception calling \"ParseInput\" with \"3\" argument(s): \"Unrecoverable error in PowerShell.\"\r\n HResult : -2146233087\r\n CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException\r\n FullyQualifiedErrorId : ParseException\r\n InvocationInfo :\r\n ScriptLineNumber : 1\r\n OffsetInLine : 1\r\n HistoryId : -1\r\n Line : $a = [System.Management.Automation.Language.Parser]::ParseInput('[int[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]',\r\n[ref]$null, [ref]$null)\r\n PositionMessage : At line:1 char:1\r\n + $a = [System.Management.Automation.Language.Parser]::ParseInput('[int …\r\n + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n CommandOrigin : Internal\r\n ScriptStackTrace : at \u003cScriptBlock>, \u003cNo file>: line 1\r\n TargetSite :\r\n Name : ConvertToMethodInvocationException\r\n DeclaringType : System.Management.Automation.ExceptionHandlingOps, System.Management.Automation, Version=7.1.3.0, Culture=neutral,\r\nPublicKeyToken=31bf3856ad364e35\r\n MemberType : Method\r\n Module : System.Management.Automation.dll\r\n StackTrace :\r\n at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName,\r\nInt32 numArgs, MemberInfo memberInfo)\r\n at CallSite.Target(Closure , CallSite , Type , String , PSReference , PSReference )\r\n at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)\r\n at System.Management.Automation.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)\r\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)\r\n Message : Exception calling \"ParseInput\" with \"3\" argument(s): \"Unrecoverable error in PowerShell.\"\r\n Data : System.Collections.ListDictionaryInternal\r\n InnerException :\r\n Type : System.Management.Automation.ParseException\r\n Message : Unrecoverable error in PowerShell.\r\n ErrorRecord :\r\n Exception :\r\n Type : System.Management.Automation.ParentContainsErrorRecordException\r\n Message : Unrecoverable error in PowerShell.\r\n HResult : -2146233087\r\n CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException\r\n FullyQualifiedErrorId : Parse\r\n TargetSite :\r\n Name : ParseInput\r\n DeclaringType : System.Management.Automation.Language.Parser\r\n MemberType : Method\r\n Module : System.Management.Automation.dll\r\n StackTrace :\r\n at System.Management.Automation.Language.Parser.ParseInput(String input, String fileName, Token[]& tokens, ParseError[]& errors)\r\n at CallSite.Target(Closure , CallSite , Type , String , PSReference , PSReference )\r\n InnerException :\r\n Type : System.TypeLoadException\r\n Message : 'System.Int32[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]' from assembly 'System.Private.CoreLib, Version=5.0.0.0, Culture=neutral,\r\nPublicKeyToken=7cec85d7bea7798e' has too many dimensions.\r\n TypeName : System.Int32[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]\r\n TargetSite :\r\n Name : MakeArray\r\n DeclaringType : System.RuntimeTypeHandle\r\n MemberType : Method\r\n Module : System.Private.CoreLib.dll\r\n StackTrace :\r\n at System.RuntimeTypeHandle.MakeArray(Int32 rank)\r\n at System.RuntimeType.MakeArrayType(Int32 rank)\r\n at System.Management.Automation.Language.ArrayTypeName.GetReflectionType()\r\n at System.Management.Automation.Language.SymbolResolver.VisitArrayTypeName(ArrayTypeName arrayTypeName)\r\n at System.Management.Automation.Language.SymbolResolver.VisitTypeExpression(TypeExpressionAst typeExpressionAst)\r\n at System.Management.Automation.Language.TypeExpressionAst.InternalVisit(AstVisitor visitor)\r\n at System.Management.Automation.Language.CommandExpressionAst.InternalVisit(AstVisitor visitor)\r\n at System.Management.Automation.Language.PipelineAst.InternalVisit(AstVisitor visitor)\r\n at System.Management.Automation.Language.StatementBlockAst.InternalVisit(AstVisitor visitor, ReadOnlyCollection`1 traps, ReadOnlyCollection`1\r\nstatements, AstVisitAction action)\r\n at System.Management.Automation.Language.NamedBlockAst.InternalVisit(AstVisitor visitor)\r\n at System.Management.Automation.Language.ScriptBlockAst.InternalVisit(AstVisitor visitor)\r\n at System.Management.Automation.Language.Ast.Visit(AstVisitor astVisitor)\r\n at System.Management.Automation.Language.SymbolResolver.ResolveSymbols(Parser parser, ScriptBlockAst scriptBlockAst)\r\n at System.Management.Automation.Language.ScriptBlockAst.PerformPostParseChecks(Parser parser)\r\n at System.Management.Automation.Language.Parser.ParseTask(String fileName, String input, List`1 tokenList, Boolean recursed, ParseMode parseMode)\r\n at System.Management.Automation.Language.Parser.Parse(String fileName, String input, List`1 tokenList, ParseError[]& errors, ParseMode parseMode)\r\n at System.Management.Automation.Language.Parser.ParseInput(String input, String fileName, Token[]& tokens, ParseError[]& errors)\r\n Source : System.Private.CoreLib\r\n HResult : -2146233054\r\n Source : System.Management.Automation\r\n HResult : -2146233087\r\n Source : System.Management.Automation\r\n HResult : -2146233087\r\nCategoryInfo : NotSpecified: (:) [], MethodInvocationException\r\nFullyQualifiedErrorId : ParseException\r\nInvocationInfo :\r\n ScriptLineNumber : 1\r\n OffsetInLine : 1\r\n HistoryId : -1\r\n Line : $a = [System.Management.Automation.Language.Parser]::ParseInput('[int[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]', [ref]$null,\r\n[ref]$null)\r\n PositionMessage : At line:1 char:1\r\n + $a = [System.Management.Automation.Language.Parser]::ParseInput('[int …\r\n + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n CommandOrigin : Internal\r\nScriptStackTrace : at \u003cScriptBlock>, \u003cNo file>: line 1\r\n```\r\n\r\n\r\n### Environment data\r\n\r\n```powershell\r\nPS:3> $PSVersionTable\r\n\r\nName Value\r\n---- -----\r\nPSVersion 7.2.0-preview.10\r\nPSEdition Core\r\nGitCommitId 7.2.0-preview.10\r\nOS Microsoft Windows 10.0.19043\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/daxian-dbw","@type":"Person","name":"daxian-dbw"},"datePublished":"2021-10-19T20:11:34Z","url":"https://github.com/PowerShell/PowerShell/issues/16275"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c6d49137-f23c-07aa-1dbd-f6d3031e35ad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEC4:25DA12:158F2C:1D76E6:6AFDF94C |
| html-safe-nonce | 8b5ad44d6e07b569cfc8b48da7293521447adbfa530d793cbfd389bb5baa8175 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUM0OjI1REExMjoxNThGMkM6MUQ3NkU2OjZBRkRGOTRDIiwidmlzaXRvcl9pZCI6IjQ2ODc4ODA1MDA5OTAwNDg1ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a2f8be1cff228ec20c29cbfa973a20751c69a30c9d7a421c402fbb1255d2e770 |
| hovercard-subject-tag | issue:1030700680 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/16275/issue_layout |
| twitter:image | https://opengraph.githubassets.com/90c1493f5d3f3893413497cf3276ae51887cd4ccaf12527e74afa783672f28ac/PowerShell/PowerShell/issues/16275 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/90c1493f5d3f3893413497cf3276ae51887cd4ccaf12527e74afa783672f28ac/PowerShell/PowerShell/issues/16275 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | daxian-dbw |
| hostname | github.com |
| expected-hostname | github.com |
| None | ee3343385a977757dd145b28fabf4a119780f2615a5a36c5a89f66c9b3b5616d |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 43ae91995f6e2d5ff7a491f3de438f1f723adeaa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width